-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathAggregatedMetric.hpp
79 lines (68 loc) · 3.58 KB
/
AggregatedMetric.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
//
#ifndef AGGREGATEDMETRIC_HPP
#define AGGREGATEDMETRIC_HPP
#include "ctmacros.hpp"
#include "ILogger.hpp"
namespace MAT_NS_BEGIN
{
namespace Models {
/// <summary>
/// The AggregatedMetric class represents an aggregated metric event.
/// </summary>
class MATSDK_LIBABI AggregatedMetric
{
public:
/// <summary>
/// An AggregatedMetric constructor. Creates an aggregated metric instance for logging auto-aggregated metrics.
/// </summary>
/// <param name="name">A string that contains the name of the auto-aggregated metric.</param>
/// <param name="units">A string that contains the units of the auto-aggregated metric.</param>
/// <param name="intervalInSec">The polling cadence (in seconds) used to aggregate the metric.</param>
/// <param name="eventProperties">The properties of the auto-aggregated metric event, as an EventProperties object.</param>
/// <param name="pLogger">An ILogger interface pointer used to log this aggregated metric.</param>
AggregatedMetric(std::string const& name,
std::string const& units,
unsigned const intervalInSec,
EventProperties const& eventProperties,
ILogger* pLogger = NULL);
/// <summary>
/// AggregatedMetric AggregatedMetric constructor that also takes an instance name, an object class, and an object ID.
/// Creates an aggregated metric instance for logging auto-aggregated metrics.
/// </summary>
/// <param name="name">A string that contains the name of the auto-aggregated metric.</param>
/// <param name="units">A string that contains the units of the auto-aggregated metric.</param>
/// <param name="intervalInSec">The polling cadence (in seconds) used to aggregate the metric.</param>
/// <param name="instanceName">A string that contains the name of this metric instance - like for performance counter.</param>
/// <param name="objectClass">A string that contains the object class for which this metric is trackings.</param>
/// <param name="objectId">A string that contains the object ID for which this metric is trackings.</param>
/// <param name="eventProperties">The properties of the auto-aggregated metric event, as an EventProperties object.</param>
/// <param name="pLogger">An ILogger interface pointer used to log this aggregated metric.</param>
AggregatedMetric(std::string const& name,
std::string const& units,
unsigned const intervalInSec,
std::string const& instanceName,
std::string const& objectClass,
std::string const& objectId,
EventProperties const& eventProperties,
ILogger* pLogger = NULL);
/// <summary>
/// The AggregatedMetric destructor.
/// </summary>
~AggregatedMetric();
/// <summary>
/// Pushes a single metric value for auto-aggregation.
/// </summary>
/// <param name="value">The metric value to push.</param>
void PushMetric(double value);
private:
/// <summary>
/// Actual implementation of AggregatedMetric.
/// </summary>
void* m_pAggregatedMetricImpl;
};
} // Models
} MAT_NS_END
#endif