-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ingest cloud resource specifications #1199
Ingest cloud resource specifications #1199
Conversation
protected function transform(array $srcRecord, &$orderId) | ||
{ | ||
// We want to just flush when we hit the dummy row | ||
if ($srcRecord[array_keys($srcRecord)[0]] == 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
==
-> ===
} | ||
|
||
$messages = null; | ||
$this->initialized = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please explain why initialised is set here
Kudos, SonarCloud Quality Gate passed!
|
This PR adds functionality to track the vcpu and memory specifications of cloud resources over time. A new ingestor class has been created called StateReconstructorTransformIngestor. This class simulates a Finite State Machine to construct a single row with a start and end time. Given a list of records with a time when the event the record describes takes place, records with a start and end times for unique column values based on criteria specified in the action definition file are created.
In the case of the cloud resource specifications, specification information and the date that information was recorded are used to create rows with start end end times for each unique combination of resource_id, hostname, vcpus and memory.
There are other instances where this ingestor class will be useful such as construcing start and end times for instance type configurations or the start and end times for XSEDE allocations. In each case the columns used to construct the new rows may be unique to each use case. In order to allow for ease of reuse of this class without having to make new ingestor classes each time a json object in added to the action definition file to specify the column names used in the ingestor class.
Below is the json object that should be added to the action definition file. Each field should list at least one column from the source query.
Component tests have been added for the new ingestor class.
Tests performed
Added new component test and tested manually in docker
Types of changes
Checklist: