00001 // Licensed to the Apache Software Foundation (ASF) under one 00002 // or more contributor license agreements. See the NOTICE file 00003 // distributed with this work for additional information 00004 // regarding copyright ownership. The ASF licenses this file 00005 // to you under the Apache License, Version 2.0 (the 00006 // "License"); you may not use this file except in compliance 00007 // with the License. You may obtain a copy of the License at 00008 // 00009 // http://www.apache.org/licenses/LICENSE-2.0 00010 // 00011 // Unless required by applicable law or agreed to in writing, 00012 // software distributed under the License is distributed on an 00013 // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 00014 // KIND, either express or implied. See the License for the 00015 // specific language governing permissions and limitations 00016 // under the License. 00017 #ifndef KUDU_CLIENT_RESOURCE_METRICS_H 00018 #define KUDU_CLIENT_RESOURCE_METRICS_H 00019 00020 #include <map> 00021 #include <stdint.h> 00022 #include <string> 00023 00024 #include "kudu/util/kudu_export.h" 00025 00026 namespace kudu { 00027 namespace client { 00028 00030 class KUDU_EXPORT ResourceMetrics { 00031 public: 00032 ResourceMetrics(); 00033 00034 ~ResourceMetrics(); 00035 00038 std::map<std::string, int64_t> Get() const; 00039 00047 void Increment(const std::string& name, int64_t amount); 00048 00054 int64_t GetMetric(const std::string& name) const; 00055 00056 private: 00057 class KUDU_NO_EXPORT Data; 00058 Data* data_; 00059 }; 00060 00061 } // namespace client 00062 } // namespace kudu 00063 00064 #endif