-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Graphs & Configure Infrastructure (#1023)
* Rework Inference Metrics & Add Runtime Metrics (invalid quieries) * Add stacked line chart functionality
- Loading branch information
1 parent
8741023
commit d9e950c
Showing
18 changed files
with
504 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
frontend/src/pages/modelServing/screens/metrics/InferenceGraphs.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import * as React from 'react'; | ||
import { Stack, StackItem } from '@patternfly/react-core'; | ||
import MetricsChart from '~/pages/modelServing/screens/metrics/MetricsChart'; | ||
import { | ||
InferenceMetricType, | ||
ModelServingMetricsContext, | ||
} from '~/pages/modelServing/screens/metrics/ModelServingMetricsContext'; | ||
import { TimeframeTitle } from '~/pages/modelServing/screens/types'; | ||
import { per100 } from './utils'; | ||
|
||
const InferenceGraphs: React.FC = () => { | ||
const { data, currentTimeframe } = React.useContext(ModelServingMetricsContext); | ||
|
||
const inHours = | ||
currentTimeframe === TimeframeTitle.ONE_HOUR || currentTimeframe === TimeframeTitle.ONE_DAY; | ||
|
||
return ( | ||
<Stack hasGutter> | ||
<StackItem> | ||
<MetricsChart | ||
metrics={[ | ||
{ | ||
name: 'Success http requests (x100)', | ||
metric: data[InferenceMetricType.REQUEST_COUNT_SUCCESS], | ||
translatePoint: per100, | ||
}, | ||
{ | ||
name: 'Failed http requests (x100)', | ||
metric: data[InferenceMetricType.REQUEST_COUNT_FAILED], | ||
translatePoint: (point) => { | ||
// TODO: remove when real values are used | ||
const newPoint = per100(point); | ||
const y = Math.floor(newPoint.y / (Math.floor(Math.random() * 2) + 2)); | ||
return { ...newPoint, y }; | ||
}, | ||
}, | ||
]} | ||
title={`Http requests per ${inHours ? 'hour' : 'day'} (x100)`} | ||
/> | ||
</StackItem> | ||
</Stack> | ||
); | ||
}; | ||
|
||
export default InferenceGraphs; |
Oops, something went wrong.