feat(nui): Display the amount of slow queries

This commit is contained in:
Luke committed 2022-02-02 13:55:30 +01:00
1 parent 18eb6d1f29
commit 553775c9a0
5 files changed
+10 -2

No files matched your search

+1
View File
@@ -15,6 +15,7 @@ debugData([
resources: ['ox_inventory', 'luke_garages', 'es_extended'],
totalQueries: 732,
totalTime: 258,
slowQueries: 6,
chartData: [
{ x: 13, y: 350, z: 'ox_inventory' },
{ x: 27, y: 752, z: 'es_extended' },
+1
View File
@@ -9,6 +9,7 @@ const LeftBar: React.FC = () => {
resources: [''],
totalQueries: 0,
totalTime: 0,
slowQueries: 0,
chartData: [{ x: 0, y: 0, z: '' }],
});
+4 -2
View File
@@ -8,6 +8,7 @@ const RightBar: React.FC = () => {
const [initData, setInitData] = useState<InitData>({
totalQueries: 0,
totalTime: 0,
slowQueries: 0,
resources: [''],
chartData: [{ x: 0, y: 0, z: '' }],
});
@@ -24,8 +25,9 @@ const RightBar: React.FC = () => {
<Flex direction="column" h="100%">
<Box>
<VStack align="left">
<Box>Number of queries: {initData.totalQueries}</Box>
<Box>Time querying: {Math.trunc(initData.totalTime)} ms</Box>
<Text>Number of queries: {initData.totalQueries}</Text>
<Text>Time querying: {Math.trunc(initData.totalTime)} ms</Text>
<Text color="#f3eca1">Slow queries: {initData.slowQueries}</Text>
</VStack>
</Box>
<Spacer />
+1
View File
@@ -8,5 +8,6 @@ export type InitData = {
resources: string[];
totalQueries: number;
totalTime: number;
slowQueries: number;
chartData: ChartData[];
};