Skip to content
This repository has been archived by the owner on Aug 31, 2022. It is now read-only.

Commit

Permalink
Parse iteration_name_format before building url to fetch timeseries data
Browse files Browse the repository at this point in the history
  • Loading branch information
gurbirkalsi authored and portante committed Mar 12, 2020
1 parent d061d5a commit ca82df5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 11 deletions.
32 changes: 21 additions & 11 deletions src/services/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,19 +160,29 @@ export async function queryTimeseriesData(params) {
Object.keys(clusteredIterations).forEach(primaryMetric => {
Object.keys(clusteredIterations[primaryMetric]).forEach(cluster => {
Object.keys(clusteredIterations[primaryMetric][cluster]).forEach(iteration => {
const iterationMetadata = clusteredIterations[primaryMetric][cluster][iteration];
if (iterationMetadata.iteration_name_format !== undefined) {
iterationMetadata.iteration_name_format = iterationMetadata.iteration_name_format.replace(
'%d',
iterationMetadata.iteration_number
);
iterationMetadata.iteration_name_format = iterationMetadata.iteration_name_format.replace(
'%s',
iterationMetadata.iteration_name
);
iterationMetadata.name = iterationMetadata.iteration_name_format;
} else {
iterationMetadata.name = `${iterationMetadata.iteration_number}-${
iterationMetadata.iteration_name
}`;
}
iterationRequests.push(
request.get(
`${datastoreConfig.results}/incoming/${encodeURIComponent(
clusteredIterations[primaryMetric][cluster][iteration].controller_name
)}/${encodeURIComponent(
clusteredIterations[primaryMetric][cluster][iteration].result_name
)}/${encodeURIComponent(
clusteredIterations[primaryMetric][cluster][iteration].iteration_number
)}-${encodeURIComponent(
clusteredIterations[primaryMetric][cluster][iteration].iteration_name
)}/sample${encodeURIComponent(
clusteredIterations[primaryMetric][cluster][iteration].closest_sample
)}/result.json`
`${datastoreConfig.results}/incoming/${encodeURI(
iterationMetadata.controller_name
)}/${encodeURI(iterationMetadata.result_name)}/${encodeURI(
iterationMetadata.name
)}/sample${encodeURI(iterationMetadata.closest_sample)}/result.json`
)
);
});
Expand Down
1 change: 1 addition & 0 deletions src/utils/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const parseIterationData = results => {
result.iterationData.forEach(iteration => {
let iterationMetadata = {
iteration_name: iteration.iteration_name,
iteration_name_format: iteration.iteration_name_format,
iteration_number: iteration.iteration_number,
result_name: result.resultName,
controller_name: result.controllerName,
Expand Down

0 comments on commit ca82df5

Please sign in to comment.