Skip to content

Commit

Permalink
feat(src): call storeAggregationMethods function from impactEngine
Browse files Browse the repository at this point in the history
  • Loading branch information
manushak committed Jul 23, 2024
1 parent 3836eb9 commit 4b20ff0
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions src/if-run/index.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
#!/usr/bin/env node
import {aggregate, storeAggregateMetrics} from './lib/aggregate';
import {compute} from './lib/compute';
import {STRINGS as COMMON_STRINGS} from '../common/config';
import {validateManifest} from '../common/util/validations';
import {debugLogger} from '../common/util/debug-logger';
import {logger} from '../common/util/logger';
import {load} from '../common/lib/load';

import {aggregate, storeAggregationMetrics} from './lib/aggregate';
import {injectEnvironment} from './lib/environment';
import {exhaust} from './lib/exhaust';
import {initialize} from './lib/initialize';
import {load} from '../common/lib/load';
import {compute} from './lib/compute';
import {exhaust} from './lib/exhaust';

import {parseIfRunProcessArgs} from './util/args';
import {andHandle} from './util/helpers';
import {logger} from '../common/util/logger';
import {validateManifest} from '../common/util/validations';
import {debugLogger} from '../common/util/debug-logger';
import {andHandle, storeAggregationMethods} from './util/helpers';

import {STRINGS} from './config';
import {STRINGS as COMMON_STRINGS} from '../common/config';

const {EXITING_IF, STARTING_IF} = STRINGS;
const {DISCLAIMER_MESSAGE} = COMMON_STRINGS;
Expand All @@ -32,11 +33,14 @@ const impactEngine = async () => {

try {
const {tree, ...context} = validateManifest(envManifest);
const pluginStorage = await initialize(context.initialize.plugins);

if (context.aggregation) {
storeAggregationMetrics({metrics: context.aggregation?.metrics});
}

// TODO: remove this after resolving timeSync to be a builtin functionality.
storeAggregateMetrics(context.aggregation);
storeAggregationMethods(context.initialize.plugins, pluginStorage);

const pluginStorage = await initialize(context.initialize.plugins);
const computedTree = await compute(tree, {context, pluginStorage});
const aggregatedTree = aggregate(computedTree, context.aggregation);
await exhaust(aggregatedTree, context, outputOptions);
Expand Down

0 comments on commit 4b20ff0

Please sign in to comment.