File tree Expand file tree Collapse file tree 2 files changed +14
-12
lines changed
src/components/QueriesActivityBar Expand file tree Collapse file tree 2 files changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ import {chartApi} from '../MetricChart/reducer';
1616
1717import { QueriesActivityCharts } from './QueriesActivityCharts' ;
1818import i18n from './i18n' ;
19- import { calculateLatency , calculateQueriesPerSecond } from './utils' ;
19+ import { calculateLatency , calculateQueriesPerSecond , formatTrendValue } from './utils' ;
2020
2121import './QueriesActivityBar.scss' ;
2222
@@ -108,17 +108,6 @@ export function QueriesActivityBar({tenantName}: QueriesActivityBarProps) {
108108 history . push ( path ) ;
109109 } ;
110110
111- // Helper to format trend display
112- const formatTrendValue = ( val : number ) => {
113- if ( val >= 1 ) {
114- return `+${ val . toFixed ( 0 ) } ` ;
115- } else if ( val > 0 ) {
116- return `+${ val . toFixed ( 1 ) } ` ;
117- } else {
118- return val . toFixed ( 1 ) ;
119- }
120- } ;
121-
122111 return (
123112 < div className = { b ( { expanded} ) } >
124113 < Disclosure expanded = { expanded } onUpdate = { setExpanded } className = { b ( 'disclosure' ) } >
Original file line number Diff line number Diff line change @@ -86,3 +86,16 @@ export const calculateLatency = (data?: (number | null)[]): MetricCalculationRes
8686
8787 return { value : current . toFixed ( 1 ) , trend} ;
8888} ;
89+
90+ /**
91+ * Format trend value for display
92+ */
93+ export const formatTrendValue = ( val : number ) : string => {
94+ if ( val >= 1 ) {
95+ return `+${ val . toFixed ( 0 ) } ` ;
96+ } else if ( val > 0 ) {
97+ return `+${ val . toFixed ( 1 ) } ` ;
98+ } else {
99+ return val . toFixed ( 1 ) ;
100+ }
101+ } ;
You can’t perform that action at this time.
0 commit comments