Dynatrace OneAgent SDK for C/C++  1.7.1.1
onesdk_metrics.h
Go to the documentation of this file.
1 /*
2  Copyright 2017-2019 Dynatrace LLC
3 
4  Licensed under the Apache License, Version 2.0 (the "License");
5  you may not use this file except in compliance with the License.
6  You may obtain a copy of the License at
7 
8  http://www.apache.org/licenses/LICENSE-2.0
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 */
16 
17 #ifndef ONESDK_EX_METRICS_H_INCLUDED
18 #define ONESDK_EX_METRICS_H_INCLUDED
19 
25 /*========================================================================================================================================*/
26 
27 #include "onesdk/onesdk_common.h" /* IWYU pragma: export */
28 #include "onesdk/onesdk_string.h"
29 
94 ONESDK_DECLARE_FUNCTION(void) onesdk_metric_delete(onesdk_metric_handle_t metric_handle);
95 
97 ONESDK_DECLARE_FUNCTION(onesdk_metric_handle_t) onesdk_integercountermetric_create_p(onesdk_string_t const* metric_key, onesdk_string_t const* unit, onesdk_string_t const* dimension_name);
98 
112 ONESDK_DEFINE_INLINE_FUNCTION(onesdk_metric_handle_t) onesdk_integercountermetric_create(onesdk_string_t metric_key, onesdk_string_t unit, onesdk_string_t dimension_name) {
113  return onesdk_integercountermetric_create_p(&metric_key, &unit, &dimension_name);
114 }
115 
116 
118 ONESDK_DECLARE_FUNCTION(onesdk_metric_handle_t) onesdk_floatcountermetric_create_p(onesdk_string_t const* metric_key, onesdk_string_t const* unit, onesdk_string_t const* dimension_name);
119 
133 ONESDK_DEFINE_INLINE_FUNCTION(onesdk_metric_handle_t) onesdk_floatcountermetric_create(onesdk_string_t metric_key, onesdk_string_t unit, onesdk_string_t dimension_name) {
134  return onesdk_floatcountermetric_create_p(&metric_key, &unit, &dimension_name);
135 }
136 
137 
139 ONESDK_DECLARE_FUNCTION(onesdk_metric_handle_t) onesdk_integergaugemetric_create_p(onesdk_string_t const* metric_key, onesdk_string_t const* unit, onesdk_string_t const* dimension_name);
140 
154 ONESDK_DEFINE_INLINE_FUNCTION(onesdk_metric_handle_t) onesdk_integergaugemetric_create(onesdk_string_t metric_key, onesdk_string_t unit, onesdk_string_t dimension_name) {
155  return onesdk_integergaugemetric_create_p(&metric_key, &unit, &dimension_name);
156 }
157 
159 ONESDK_DECLARE_FUNCTION(onesdk_metric_handle_t) onesdk_floatgaugemetric_create_p(onesdk_string_t const* metric_key, onesdk_string_t const* unit, onesdk_string_t const* dimension_name);
160 
174 ONESDK_DEFINE_INLINE_FUNCTION(onesdk_metric_handle_t) onesdk_floatgaugemetric_create(onesdk_string_t metric_key, onesdk_string_t unit, onesdk_string_t dimension_name) {
175  return onesdk_floatgaugemetric_create_p(&metric_key, &unit, &dimension_name);
176 }
177 
179 ONESDK_DECLARE_FUNCTION(onesdk_metric_handle_t) onesdk_integerstatisticsmetric_create_p(onesdk_string_t const* metric_key, onesdk_string_t const* unit, onesdk_string_t const* dimension_name);
180 
194 ONESDK_DEFINE_INLINE_FUNCTION(onesdk_metric_handle_t) onesdk_integerstatisticsmetric_create(onesdk_string_t metric_key, onesdk_string_t unit, onesdk_string_t dimension_name) {
195  return onesdk_integerstatisticsmetric_create_p(&metric_key, &unit, &dimension_name);
196 }
197 
199 ONESDK_DECLARE_FUNCTION(onesdk_metric_handle_t) onesdk_floatstatisticsmetric_create_p(onesdk_string_t const* metric_key, onesdk_string_t const* unit, onesdk_string_t const* dimension_name);
200 
215 ONESDK_DEFINE_INLINE_FUNCTION(onesdk_metric_handle_t) onesdk_floatstatisticsmetric_create(onesdk_string_t metric_key, onesdk_string_t unit, onesdk_string_t dimension_name) {
216  return onesdk_floatstatisticsmetric_create_p(&metric_key, &unit, &dimension_name);
217 }
218 
220 ONESDK_DECLARE_FUNCTION(void) onesdk_integercountermetric_increase_by_p(onesdk_metric_handle_t metric_handle, onesdk_int64_t delta, onesdk_string_t const* dimension);
221 
232 ONESDK_DEFINE_INLINE_FUNCTION(void) onesdk_integercountermetric_increase_by(onesdk_metric_handle_t metric_handle, onesdk_int64_t delta, onesdk_string_t dimension) {
233  onesdk_integercountermetric_increase_by_p(metric_handle, delta, &dimension);
234 }
235 
237 ONESDK_DECLARE_FUNCTION(void) onesdk_floatcountermetric_increase_by_p(onesdk_metric_handle_t metric_handle, double delta, onesdk_string_t const* dimension);
238 
249 ONESDK_DEFINE_INLINE_FUNCTION(void) onesdk_floatcountermetric_increase_by(onesdk_metric_handle_t metric_handle, double delta, onesdk_string_t dimension) {
250  onesdk_floatcountermetric_increase_by_p(metric_handle, delta, &dimension);
251 }
252 
254 ONESDK_DECLARE_FUNCTION(void) onesdk_integergaugemetric_set_value_p(onesdk_metric_handle_t metric_handle, onesdk_int64_t value, onesdk_string_t const* dimension);
255 
266 ONESDK_DEFINE_INLINE_FUNCTION(void) onesdk_integergaugemetric_set_value(onesdk_metric_handle_t metric_handle, onesdk_int64_t value, onesdk_string_t dimension) {
267  onesdk_integergaugemetric_set_value_p(metric_handle, value, &dimension);
268 }
269 
271 ONESDK_DECLARE_FUNCTION(void) onesdk_floatgaugemetric_set_value_p(onesdk_metric_handle_t metric_handle, double value, onesdk_string_t const* dimension);
272 
283 ONESDK_DEFINE_INLINE_FUNCTION(void) onesdk_floatgaugemetric_set_value(onesdk_metric_handle_t metric_handle, double value, onesdk_string_t dimension) {
284  onesdk_floatgaugemetric_set_value_p(metric_handle, value, &dimension);
285 }
286 
288 ONESDK_DECLARE_FUNCTION(void) onesdk_integerstatisticsmetric_add_value_p(onesdk_metric_handle_t metric_handle, onesdk_int64_t value, onesdk_string_t const* dimension);
289 
300 ONESDK_DEFINE_INLINE_FUNCTION(void) onesdk_integerstatisticsmetric_add_value(onesdk_metric_handle_t metric_handle, onesdk_int64_t value, onesdk_string_t dimension) {
301  onesdk_integerstatisticsmetric_add_value_p(metric_handle, value, &dimension);
302 }
303 
305 ONESDK_DECLARE_FUNCTION(void) onesdk_floatstatisticsmetric_add_value_p(onesdk_metric_handle_t metric_handle, double value, onesdk_string_t const* dimension);
306 
317 ONESDK_DEFINE_INLINE_FUNCTION(void) onesdk_floatstatisticsmetric_add_value(onesdk_metric_handle_t metric_handle, double value, onesdk_string_t dimension) {
318  onesdk_floatstatisticsmetric_add_value_p(metric_handle, value, &dimension);
319 }
320 
321 
324 #endif /* ONESDK_EX_METRICS_H_INCLUDED */
Defines common types/constants/macros. Applications should not include this file directly.
int64_t onesdk_int64_t
Signed 64 bit integer.
Definition: onesdk_config.h:216
onesdk_metric_handle_t onesdk_integercountermetric_create(onesdk_string_t metric_key, onesdk_string_t unit, onesdk_string_t dimension_name)
DEPRECATED. Creates a metric to count (sum up) some 64 bit integer values, e.g., number of records in...
Definition: onesdk_metrics.h:112
void onesdk_floatstatisticsmetric_add_value(onesdk_metric_handle_t metric_handle, double value, onesdk_string_t dimension)
DEPRECATED. Records the current value for the metric_handle for dimension to value.
Definition: onesdk_metrics.h:317
Represents a reference to string data in a user specified encoding.
Definition: onesdk_string.h:59
void onesdk_floatgaugemetric_set_value(onesdk_metric_handle_t metric_handle, double value, onesdk_string_t dimension)
DEPRECATED. Set the last sampled value for the metric_handle for dimension to value.
Definition: onesdk_metrics.h:283
onesdk_handle_t onesdk_metric_handle_t
A handle that refers to a metric object.
Definition: onesdk_common.h:490
onesdk_metric_handle_t onesdk_integergaugemetric_create(onesdk_string_t metric_key, onesdk_string_t unit, onesdk_string_t dimension_name)
DEPRECATED. Creates a metric to sample (periodically measure) some 64 bit integer value...
Definition: onesdk_metrics.h:154
onesdk_metric_handle_t onesdk_floatstatisticsmetric_create(onesdk_string_t metric_key, onesdk_string_t unit, onesdk_string_t dimension_name)
DEPRECATED. Creates a metric to track (measure on each change, event-driven) some double precision fl...
Definition: onesdk_metrics.h:215
onesdk_metric_handle_t onesdk_floatgaugemetric_create(onesdk_string_t metric_key, onesdk_string_t unit, onesdk_string_t dimension_name)
DEPRECATED. Creates a metric to sample (periodically measure) some double precision floating point va...
Definition: onesdk_metrics.h:174
void onesdk_floatcountermetric_increase_by(onesdk_metric_handle_t metric_handle, double delta, onesdk_string_t dimension)
DEPRECATED. Increase the counter metric_handle for dimension by the given delta.
Definition: onesdk_metrics.h:249
void onesdk_integergaugemetric_set_value(onesdk_metric_handle_t metric_handle, onesdk_int64_t value, onesdk_string_t dimension)
DEPRECATED. Set the last sampled value for the metric_handle for dimension to value.
Definition: onesdk_metrics.h:266
void onesdk_metric_delete(onesdk_metric_handle_t metric_handle)
DEPRECATED. Releases a metric object.
void onesdk_integerstatisticsmetric_add_value(onesdk_metric_handle_t metric_handle, onesdk_int64_t value, onesdk_string_t dimension)
DEPRECATED. Records the current value for the metric_handle for dimension to value.
Definition: onesdk_metrics.h:300
onesdk_metric_handle_t onesdk_integerstatisticsmetric_create(onesdk_string_t metric_key, onesdk_string_t unit, onesdk_string_t dimension_name)
DEPRECATED. Creates a metric to track (measure on each change, event-driven) some 64 bit integer valu...
Definition: onesdk_metrics.h:194
onesdk_metric_handle_t onesdk_floatcountermetric_create(onesdk_string_t metric_key, onesdk_string_t unit, onesdk_string_t dimension_name)
DEPRECATED. Creates a metric to count (sum up) some double precision floating point values...
Definition: onesdk_metrics.h:133
void onesdk_integercountermetric_increase_by(onesdk_metric_handle_t metric_handle, onesdk_int64_t delta, onesdk_string_t dimension)
DEPRECATED. Increase the counter metric_handle for dimension by the given delta.
Definition: onesdk_metrics.h:232
Defines onesdk_string_t, the string type used for tracing, plus related utility functions.