//////////////////////////////////////////////////////////////////////////////// /// DISCLAIMER /// /// Copyright 2018 ArangoDB GmbH, Cologne, Germany /// /// Licensed under the Apache License, Version 2.0 (the "License"); /// you may not use this file except in compliance with the License. /// You may obtain a copy of the License at /// /// http://www.apache.org/licenses/LICENSE-2.0 /// /// Unless required by applicable law or agreed to in writing, software /// distributed under the License is distributed on an "AS IS" BASIS, /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. /// See the License for the specific language governing permissions and /// limitations under the License. /// /// Copyright holder is ArangoDB GmbH, Cologne, Germany /// /// @author Simon Grätzer //////////////////////////////////////////////////////////////////////////////// #ifndef ARANGOD_STATISTICS_DESCRIPTIONS_H #define ARANGOD_STATISTICS_DESCRIPTIONS_H 1 #include "Basics/Common.h" #include #include #include "Statistics/RequestStatistics.h" namespace arangodb { namespace stats { enum class GroupType { System, Client, ClientUser, Http, Vst, Server }; std::string fromGroupType(stats::GroupType); struct Group { stats::GroupType type; std::string name; std::string description; public: void toVPack(velocypack::Builder&) const; }; enum class FigureType : char { Current, Accumulated, Distribution }; std::string fromFigureType(stats::FigureType); enum class Unit : char { Seconds, Bytes, Percent, Number }; std::string fromUnit(stats::Unit); struct Figure { stats::GroupType groupType; std::string identifier; std::string name; std::string description; stats::FigureType type; stats::Unit units; std::vector cuts; public: void toVPack(velocypack::Builder&) const; }; class Descriptions final { public: Descriptions(); std::vector const& groups() const { return _groups; } std::vector const& figures() const { return _figures; } void serverStatistics(velocypack::Builder&) const; void clientStatistics(velocypack::Builder&, RequestStatistics::Source source) const; void httpStatistics(velocypack::Builder&) const; void processStatistics(velocypack::Builder&) const; private: std::vector _requestTimeCuts; std::vector _connectionTimeCuts; std::vector _bytesSendCuts; std::vector _bytesReceivedCuts; std::vector _groups; std::vector _figures; }; } // namespace stats } // namespace arangodb #endif