flush() should not produce a metric if value is None (causes
exception in monasca-api).
Fix the exception message in flush() to use the correct data
structure.
Change-Id: I62d31270db9e70f16d2a38a73856009c52c098e6
Story: 2004276
Task: 27825
* set the maximum line length to 100
* cleaned up the codes for pep8
Depends-On: https://review.openstack.org/560844
Change-Id: Id548b78b673cce869ef8291bdb6b4f1367b383ed
Signed-off-by: Jui Chandwaskar <jchandwaskar@op5.com>
* Support tags
* Support timer (provisional by mapping metric type 'ms' to 'gauge')
* Support histograms (same)
* Support service-checks (by mapping status to gauge)
* Fix calculation of counters for sporadic metrics and sample-rates < 1
Story: 2000951
Task: 4079
Task: 3944
Change-Id: Ib4996b88a2845bceda9c803a386b76b2e0ae125a
Adding unit tests for metric types.
Fixing bug in log message.
Change-Id: I66e4279dfaad2f67d80b46a7eaf594f93c35d62f
Depends-On: Ibcf73b5ac661f4c0575f2dfb7d2d973d3c006fe2
Old code was using if not self.value: which does not work correctly
for a value of 0 which is a valid value for a Gauge
Change-Id: I4a39eaa156676ced5a0c07db781e5292d69a2e60
Closes-Bug: #1610719
Saw error message in collector log showing:
AttributeError: 'Rate' object has no attribute 'name'
In the new base metric class init function, variable name
got passed into self.metric. That's why self.name doesn't
exist anymore.
Change-Id: Idfd2fe5d257332327449e2766544dd36d8a003c1
The forwarder modified the timestamp and possibly the tenant_id of every
measurement sent to it. This modification does the processing on those
attributes in the collector and sends the forwarder the final set of data.
Value meta can't be part of the context used to determine if we have a new
metric. Value meta can change while the metric itself remains the same which
means that we construct a new metric object each time we get a new value meta
value. This doesn't have any effect on Gauge metrics but Counter and Rate
metrics return invalid data as value meta changes. To fix this value meta is
now applied to each sample instead of being assigned during __init__.
Change-Id: I1d6a52266755b2e20149ef7ec6eb76fe2459b2a8
Closes-Bug: #1596686
Also report the actual value in the log message to
help debugging later on.
Removed 'raise e' because we don't want to raise an
exception in sample() and lose the metrics after it
Change-Id: I9f9cbc492ef17a484cfefca1188d295c490d8578
If a value is reset on flush(), it will subsequently fail
on sample(). This seems to affect a subset of statsd metrics,
filling the log with "Error receiving datagram" messages.
This patch also fixes a couple very minor PEP8 issues.
Change-Id: I7dfb3b62fcf110ba7dd0ef2d3e6f40ee7c1891ef
If an invalid metric type makes it through StatsD we can handle
it more gracefully by logging the type error instead of producing
a stack dump.
Change-Id: I05c0042d9132efc2a856db43923873f1f6bcb3d2
The value_meta parameter was recently added to the
monasca-api. This allows the addition of meta-information
to be sent with any metrics that are sent from the agent.
value_meta was added for the http_status, nagios_wrapper,
and host_alive checks in the agent. Also, consolidated
some of the duplicate exception handling and reformatted
some code blocks.
Change-Id: I3d9e9a8e54cd2582bde47c7c128a3788b821c156
Some disk partitions do not have associated I/O metrics. This
was causing an exception when trying to retrieve them. If the
partition doesn't have I/O metrics, just skip it. Also, fixed
an issue where the dimensions were not getting updated correctly.
Change-Id: Ie984e1fe589f9356b4009d613fe7d1e0f4e18439
to the normalize functionality that was removed in the past and
was causing errors in the Histogram and Counter calculations in
statsd metrics.
Change-Id: I36ac2d2d7598c00b1b33dbb2cfa81c56145e398b
Fixed issue with flushing of metrics. Also cleaned up the code
some and rearranged code to avoid a double try block in the Rate
class.
Change-Id: I51148f8b73009dc2ec1f616ef68614e05bbda84d
Recently changed the statsd aggregator to use the Gauge instead
of the BucketGauge. BucketGauge class not used anymore.
Change-Id: I60faad0299a533f3beb383f4f0bf0ceb9bd32c90
Also I removed the expiry check on flushing metrics, there is already a
check on submission to see if a submitted metric is old. This would only
catch metrics that were submitted correctly but took to long to be
processed by the collector.
Lastly I removed the MetricsBucketAggregator and combined all things
into a single aggregator. Only statsd was using the bucket aggregator
and there is no advantage over the other.
Change-Id: I1a2a0c9941a95558036233e61ac3f5f395ed54d5
Fixed duplicate metrics being created for each statsd counter.
Fixed accidental setting of device_name for statsd counters.
Standardized to 20 second report times.
Change-Id: I55db0d59d783da19cffa53e7c34eff91f55db840
Renamed monagent package to monasca_agent and monsetup package to monasca_setup.
Also, renamed the monstatsd agent package to statsd to more closely match the internal
collector and forwarder packages.
Change-Id: I0649ae4341fe325007e2a8d37161d330e4c95d72