Commit Graph

38 Commits

Author SHA1 Message Date
Witek Bedyk 811acd76c9 Remove project content on master branch
This is step 2b of repository deprecation process as described in [1].
Project deprecation has been anounced here [2].

[1] https://docs.openstack.org/project-team-guide/repository.html#step-2b-remove-project-content
[2] http://lists.openstack.org/pipermail/openstack-discuss/2020-August/016814.html

Depends-On: https://review.opendev.org/751983
Change-Id: I83bb2821d64a4dddd569ff9939aa78d271834f08
2020-09-15 10:12:44 +02:00
Sean McGinnis 9f49754799
Use unittest.mock instead of third party mock
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.

Change-Id: I5868501da8cfc975c62e63a106f0fcae2384112a
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-05-13 06:01:39 -05:00
sajuptpm 410115088e Enable mutable config in monasca_transform
New releases of oslo.config support a 'mutable' parameter to Opts.
oslo.service provides an option here Icec3e664f3fe72614e373b2938e8dee53cf8bc5e
allows services to tell oslo.service they want mutate_config_files to be
called by passing a parameter.

This commit is to use the same. This allows monasca_transform to benefit from
I1e7a69de169cc85f4c09954b2f46ce2da7106d90, where the 'debug' option
(owned by oslo.log) is made mutable. we should be able to turn debug
logging on and off by changing the config.

tc goal:
https://governance.openstack.org/tc/goals/rocky/enable-mutable-configuration.html

Change-Id: I86571df78014a810ffa881ceceeddfc5193c9ca5
2018-07-25 16:42:42 +05:30
Ashwin Agate 94510afed9 Check periodically if host is leader
Check periodically if host continues to be a
leader once elected. Failure to check
might lead to a situation where the host
has lost leadership but is not aware of the
situation.
If the host is no longer the leader then
stand down as a leader, stop any spark-submit
processes running on the node and reset state
in the transform thread.
Removed --supervise option when invoking
spark-submit to turn off built in driver
management.
Added some hardening to better catch exceptions
in main transform service thread and also
periodic leader check function so that the
threads don't die when they encounter
an unhandled exception.

Change-Id: If2e13e3ed6cb30b3d7fa5f1b440c4c39b87692be
2017-07-05 23:13:29 -07:00
Ashwin Agate f99a3faf68 Fix development environment and functional tests
Changing devstack environment vagrant box and
also rename the devstack VM to 'devstack'
from 'pg-tips'

Also fixing all the tests that were broken when
they were moved from tests/unit to tests/functional
with this review
https://review.openstack.org/#/c/400237/

Update devstack README with a section called
Development workflow for monasca-transform with
steps developers can take to develop and run
tests.

Change-Id: I11678148ba2bcb96eb3e2a522176683dc8bca30a
2017-04-11 12:13:25 -07:00
David C Kennedy 00b4797a65 Corrected catch up aggregation logic
Fixed a bug where the hourly agregation would run at every iteration
if the hour is zero (midnight) because zero is falsey.

Change-Id: I9652f02aea30f3ddb6f154db716aa4057455be06
2017-02-14 14:56:23 +00:00
David C Kennedy 26e53336d4 Add configurable amnesty period for late metrics
Added configuration option to allow the pre-hourly transformation to be
done at a specified period past the hour.  This includes a check to
ensure that if not done yet for the hour but overdue processing is done
at the earliest time.

Change-Id: I8882f3089ca748ce435b4e9a92196a72a0a8e63f
2016-11-22 13:03:52 +00:00
David C Kennedy d76af6a0f0 Corrected test environment
Moved what were called unit tests to the functional directory as there is
more work to be done to make them self supporting.
Added sphinx to the test-requirements along with testr deps.
Adjusted the tox.ini to suit.
Added doc source tree with the minimal set of files to allow sphinx
success.

Change-Id: Ic64c2ccd01778bb0d1142d12ca43b2346bdc7aa7
2016-11-22 10:24:07 +00:00
David C Kennedy 8a6e619f72 Populate the project id for kafka publish
This needs to be the admin project id so for devstack this needs to be written
to the configuration file once the users/projects etc are created and
identifiable.
Add a similar process to the refresh script.
Correct the configuration property name to 'project' rather than using the old
nomencature 'tenant'.

Change-Id: Ib9970ffacf5ee0f7f006722038a1db8024c1385e
2016-11-11 15:24:22 +00:00
Ashwin Agate 1c65ca011b Validate metrics before publishing to kafka
Validate monasca metrics using monasca-common
validate library (requires monasca-common >= 1.1.0)

Change-Id: Iea784edbb3b57db57e6a90d1fc557b2c386c3713
2016-09-30 19:07:02 +00:00
Flint Calvin 0ea79c0305 Added aggregation results to application log
Made changes such that debug-level log entries are written to
the application log noting which aggregated metrics are submitted
during pre-hourly and hourly processing.

Change-Id: I64c6a18233614fe680aa0b084570ee7885f316e5
2016-09-23 18:24:20 +00:00
Flint Calvin 4edad0286a Eliminated ceiling function for utilization metrics
Removed the calls to the ceiling function on utilization
metrics aggregation such that they now are exact values (i.e.,
not rounded up to the next integral value).

Change-Id: I9813b94acb051f6754da2d559090318010f86e57
2016-09-09 21:07:29 +00:00
Flint Calvin 3cdb0d1687 Made corrections such that swiftlm.diskusage.rate_agg is now
correctly based on swiftlm.diskusage.host.val.avail (instead of
incorrectly being based on swiftlm.diskusage.host.val.size).

Change-Id: If17853e166c050cefbf390791a8696ce520fca96
2016-09-06 20:52:49 +00:00
Flint Calvin bf2e42b3e0 Made changes to prevent multiple metrics in the same batch.
Change-Id: Iec9935c21d8b65bf79067d4a009859c898b75993
2016-08-31 18:18:25 +00:00
Jenkins 424077c581 Merge "Added aggregation of storage-objects.size." 2016-08-19 22:09:44 +00:00
Flint Calvin eff0e74c50 Eliminated processing_meta from hourly metrics.
Change-Id: Ibcb00cae12d87e93546bddf14a796662425f7167
2016-08-18 23:25:06 +00:00
Flint Calvin d4f791e9ef Added aggregation of storage-objects.size.
Change-Id: Iafd5ff8a8faf958ac9bada9981e8cd419d82ed2e
2016-08-18 20:09:30 +00:00
Flint Calvin 0365bfa5bb Modifications to include processing_meta in pre-hourly metrics.
Change-Id: I3464008cf8695864b75cbbbfd6570db5defa8cb5
2016-08-16 22:27:04 +00:00
Flint Calvin 615e52d5cd Modifications to make rate calculations work with two-stage
aggregation.

Change-Id: I8c7b6112a04ba378ba1911a342cb97e8c388ebc6
2016-08-09 16:33:34 +00:00
Jenkins a3f7d0e845 Merge "add test_fetch_quantity_util_agg" 2016-08-05 19:16:37 +00:00
Flint Calvin accbacb19e Reintroduced some aggregations which were apparently lost when
we transitioned to the upstream Monasca-Transform OpenStack repo.
Specifically, the missing aggregations were those for the
nova.vm.cpu.total_allocated and nova.vm.mem.total_allocated_mb
source metrics.
This set of changes also includes the resolution of a couple
pre-existing pep8 errors.

Change-Id: I84bf19b674aeadcd0d27799a887d0b89d0381550
2016-08-04 15:13:43 +00:00
Michael Dong 442b7fbfb1 add test_fetch_quantity_util_agg
add data for second stage util aggregation test case.

Change-Id: I824e731d15047762474d7b33924fe80a30392be6
2016-08-02 14:31:59 -07:00
Michael Dong 6b40f661ad add test cases for first and second stage of host and vm cpu usage processing
Add more test data.

Change-Id: I824823cf7b6447ddd62f6d67d0de855d70ba4713
2016-07-28 15:12:08 -07:00
Flint Calvin a9775506cb Removed 'device' as an expected dimension on incoming Swift
metrics (since it is no longer included in them).

Change-Id: Ide8a463b8678aec38857e6376118a09588b98e0a
2016-07-28 16:09:27 +00:00
Jenkins beae384c2d Merge "add test cases for fetch_quantity_prehourly_instance_usage" 2016-07-28 14:51:21 +00:00
darfed bb83b30dc1 Add TLS/SSL capability to database connection
Add properties to conf file to allow configuration of
SSL for the database connection.  Done for both the python
and java connection strings.

Change-Id: I4c3d25c3f8f12eae801a6a818bf4ac7acd93d2dc
2016-07-28 10:12:10 +01:00
Michael Dong acba1782ad add test cases for fetch_quantity_prehourly_instance_usage
Removed dependency of yaml module.

Change-Id: I87ce80d420bc75ddbef2c8454f088be25f9ff908
2016-07-25 12:19:24 -07:00
Michael Dong c498564929 add 'string' to all firstrecord_timestamp and lastrecord_timestamp to fix bug
Closes-Bug:#1603529

Change-Id: I5585fc5c376e3220d79d22be3394e3b6ad0e6214
2016-07-19 13:22:51 -07:00
Jenkins 3bf98a894b Merge "Added filter capability for transform specs." 2016-07-19 03:02:55 +00:00
Flint Calvin c7128b0136 Added filter capability for transform specs.
Change-Id: Ie5b456039c9810da19c1699cc7d5a44277496843
2016-07-18 22:24:05 +00:00
Ashwin Agate 90b20bfd41 Change to monasca-common simport
Use monasca-common simport library

Closes-Bug: #1596331

Change-Id: I695d6db9c5c49c0120e73b76ea75f7a30222419d
2016-07-09 19:04:19 +00:00
David C Kennedy b3f85e134e Change jdbc driver to drizzle
drizzle is BSD licensed compared with the GPLv2 mysql-connector from oracle.

Change-Id: Ie203a285cf031e5c29d6d7673fab437cfe8acca4
2016-07-08 18:29:24 +00:00
Ashwin Agate 00b874a6b3 Two stage transformation
Breaking down the aggregation into two stages.

The first stage aggregates raw metrics frequently and is
implemented as a Spark Streaming job which
aggregates metrics at a configurable time interval
(defaults to 10 minutes) and writes the intermediate
aggregated data, or instance usage data
to new "metrics_pre_hourly" kafka topic.

The second stage is implemented
as a batch job using Spark Streaming createRDD
direct stream batch API, which is triggered by the
first stage only when first stage runs at the
top of the hour.

Also enhanced kafka offsets table to keep track
of offsets from two stages along with streaming
batch time, last time version row got updated
and revision number. By default it should keep
last 10 revisions to the offsets for each
application.

Change-Id: Ib2bf7df6b32ca27c89442a23283a89fea802d146
2016-06-28 13:47:50 +00:00
Flint Calvin d8e73f3bde Added several Swift aggregations (including a new usage
component for calculating rate changes).  Also fixed some pep8
issues.

Change-Id: I46685d39ace663595aa524f04d8d35a71c9432c3
2016-06-21 19:44:02 +00:00
Flint Calvin c7aabb6927 Added aggregation for vm.mem.used_mb and
swiftlm.diskusage.host.val.size.  Also renamed disk.allocation to
vm.disk.allocation and resolved a problem with resource_id not
being found for certain aggregations.

Change-Id: Iad82d149e7a04ed1e0ecfe936b90acfff1dca13e
2016-06-13 22:38:46 +00:00
Flint Calvin 11e8bac2cf Added aggregation for cpu.total_logical_cores and
cpu.utilized_logical_cores by host.

Change-Id: Ib6c6def9f882ad0fb010494a5561225c37882a07
2016-06-06 15:12:31 +00:00
Flint Calvin e4ade60711 Implemented aggregation for disk.allocation. Also set the
apache download source to use the archive site to ensure that
the dependency package does not disappear.  Also brought the
vagrant environment inline with monasca-api (i.e., use the
same values for private network, add substitution for kafka
brokers ip address to the conf).  Also parameterised
dependency sources (i.e., added settings to parameterise the
maven and apache repositories for the devstack plugin).

Change-Id: If9f0e2ed16bbfcd62152d29e5c7c86f5d555f9aa
2016-06-01 15:56:26 +00:00
Ashwin Agate 8f61dd95a9 monasca-transform initial commit
The monasca-transform is a new component in Monasca that
aggregates and transforms metrics.

monasca-transform is a Spark based data driven aggregation
engine which collects, groups and aggregates existing individual
Monasca metrics according to business requirements and publishes
new transformed (derived) metrics to the Monasca Kafka queue.

Since the new transformed metrics are published as any other
metric in Monasca, alarms can be set and triggered on the
transformed metric, just like any other metric.

Co-Authored-By: Flint Calvin <flint.calvin@hp.com>
Co-Authored-By: David Charles Kennedy <david.c.kennedy@hpe.com>
Co-Authored-By: Ashwin Agate <ashwin.agate@hp.com>

Implements: blueprint monasca-transform

Change-Id: I0e67ac7a4c9a5627ddaf698855df086d55a52d26
2016-05-26 00:10:37 +00:00