Skip to content
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

Merged
merged 9 commits into from
Jan 17, 2020

Conversation

eiffel777
Copy link
Contributor

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.

state_reconstruction_fields: {
     "end_time": "",
     "new_row": [],
     "update_row": [],
     "reset_row": [],
     "order_by": []
}

Component tests have been added for the new ingestor class.

Tests performed

Added new component test and tested manually in docker

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project as found in the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@eiffel777 eiffel777 added Category:Cloud Cloud Realm new feature New functionality labels Jan 14, 2020
@eiffel777 eiffel777 added this to the 9.0.0 milestone Jan 14, 2020
@eiffel777 eiffel777 self-assigned this Jan 14, 2020
protected function transform(array $srcRecord, &$orderId)
{
// We want to just flush when we hit the dummy row
if ($srcRecord[array_keys($srcRecord)[0]] == 0) {
Copy link
Contributor

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;
Copy link
Member

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

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 15 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@eiffel777 eiffel777 merged commit 8f1b88d into ubccr:xdmod9.0 Jan 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category:Cloud Cloud Realm new feature New functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants