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

ui: RequestsGraph shows absolute and relative data #1137

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions ui/src/components/graphs/RequestsGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ interface RequestsGraphProps {
uPlotCursor: uPlot.Cursor
type: ObjectiveType
updateTimeRange: (min: number, max: number, absolute: boolean) => void
absolute: boolean
}

const RequestsGraph = ({
Expand All @@ -33,6 +34,7 @@ const RequestsGraph = ({
uPlotCursor,
type,
updateTimeRange,
absolute = false,
}: RequestsGraphProps): JSX.Element => {
const targetRef = useRef() as React.MutableRefObject<HTMLDivElement>

Expand Down Expand Up @@ -115,7 +117,7 @@ const RequestsGraph = ({
query,
)}&g0.range_input=${formatDuration(to - from)}&g0.tab=0`}>
<IconExternal height={20} width={20} />
<span>Prometheus</span>
Prometheus
</a>
</div>
<div>
Expand Down Expand Up @@ -146,7 +148,7 @@ const RequestsGraph = ({
x: {min: from / 1000, max: to / 1000},
y: {
range: {
min: {hard: 0},
min: absolute ? {hard: 0, mode: 1, soft: 0} : {hard: 0},
max: {},
},
},
Expand Down
1 change: 1 addition & 0 deletions ui/src/pages/Detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ const Detail = () => {
uPlotCursor={uPlotCursor}
type={objectiveType}
updateTimeRange={updateTimeRangeSelect}
absolute={absolute}
/>
) : (
<></>
Expand Down
Loading