Skip to content

Commit

Permalink
model: add .env.example
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcook1186 committed Nov 1, 2023
1 parent 389ad4a commit 9e38a3e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
9 changes: 9 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
AZURE_CLIENT_ID:
AZURE_TENANT_ID:
AZURE_CLIENT_SECRET:
AZURE_CLIENT_SECRET_ID:
AZURE_APPLICATION_ID:
AZURE_SUBSCRIPTION_ID:
AZURE_RESOURCE_ID: /subscriptions/<subscription-id>/resourceGroups/<resource-group-name>/providers/Microsoft.Compute/virtualMachines/<vm-name>
AZURE_RESOURCE_GROUP_NAME:
AZURE_VM_NAME:
2 changes: 1 addition & 1 deletion src/__tests__/unit/lib/azure-importer/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('sci:configure test', () => {
model.execute([
{
duration: 3600,
timestamp: '2021-01-01T00:00:00Z',
timestamp: '2023-11-01T14:45:00Z',
interval: 'PT1M',
timespan: 'PT1H',
aggregation: 'average',
Expand Down
10 changes: 7 additions & 3 deletions src/lib/azure-importer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,20 @@ export class AzureImporterModel implements IOutputModelInterface {
});

//Call the function and get data back in AzureOutputs object
const rawResults = this.getVmUsage(
const rawResults = await this.getVmUsage(
myRG,
myVM,
mySubscriptionId,
this.timespan,
this.interval,
this.aggregation
);
console.log(rawResults);

console.log('rawResults', rawResults);

for (let i = 0; i < rawResults.timestamps.length; i++) {
console.log(i);
}

// here we need to iterate over elements in each field in `rawResults: AzureOutputs` and append each value to our yaml file
// --->
Expand Down Expand Up @@ -161,7 +166,6 @@ export class AzureImporterModel implements IOutputModelInterface {
}
);

console.log('RAM Usage:');
for (const timeSeries of ramMetricsResponse.value[0].timeseries || []) {
for (const data of timeSeries.data || []) {
if (!(typeof data.average === 'undefined')) {
Expand Down

0 comments on commit 9e38a3e

Please sign in to comment.