Skip to content

feat: add connection statistics for workspace agents #6469

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

Merged
merged 29 commits into from
Mar 9, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
8f1f141
fix: don't make session counts cumulative
kylecarbs Mar 2, 2023
ddf9841
Add databasefake query for getting agent stats
kylecarbs Mar 2, 2023
28d6db5
Add deployment stats endpoint
kylecarbs Mar 2, 2023
29719a4
The query... works?!?
kylecarbs Mar 2, 2023
09a2dad
Fix aggregation query
kylecarbs Mar 6, 2023
12a52b1
Select from multiple tables instead
kylecarbs Mar 6, 2023
a1804a9
Fix continuous stats
kylecarbs Mar 6, 2023
93f013b
Increase period of stat refreshes
kylecarbs Mar 6, 2023
50260c3
Add workspace counts to deployment stats
kylecarbs Mar 7, 2023
d1bae99
fmt
kylecarbs Mar 7, 2023
9fe9d4c
Add a slight bit of responsiveness
kylecarbs Mar 7, 2023
00ebe2e
Fix template version editor overflow
kylecarbs Mar 7, 2023
cd76533
Add refresh button
kylecarbs Mar 7, 2023
506740b
Fix font family on button
kylecarbs Mar 7, 2023
1924f58
Merge branch 'main' into exportstats
kylecarbs Mar 7, 2023
9f00ac5
Fix latest stat being reported
kylecarbs Mar 7, 2023
4b6992c
Merge branch 'main' into exportstats
kylecarbs Mar 7, 2023
1af9f64
Revert agent conn stats
kylecarbs Mar 7, 2023
e3ca39f
Merge branch 'main' into exportstats
kylecarbs Mar 7, 2023
8ad39d6
Fix linting error
kylecarbs Mar 7, 2023
0f06b23
Fix tests
kylecarbs Mar 7, 2023
e87ba59
Fix gen
kylecarbs Mar 7, 2023
99d7d1a
Fix migrations
kylecarbs Mar 7, 2023
37ad03f
Block on sending stat updates
kylecarbs Mar 7, 2023
415d8b1
Merge branch 'main' into exportstats
kylecarbs Mar 7, 2023
0037a64
Add test fixtures
kylecarbs Mar 8, 2023
3d70b2a
Merge branch 'main' into exportstats
kylecarbs Mar 9, 2023
d708210
Fix response structure
kylecarbs Mar 9, 2023
c951d5a
make gen
kylecarbs Mar 9, 2023
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
Prev Previous commit
Next Next commit
fmt
  • Loading branch information
kylecarbs committed Mar 7, 2023
commit d1bae998d6558cd7598d9377abc90917be3aadcb
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { Story } from "@storybook/react"
import { MockDeploymentStats } from "testHelpers/entities"
import { DeploymentBannerView, DeploymentBannerViewProps } from "./DeploymentBannerView"
import {
DeploymentBannerView,
DeploymentBannerViewProps,
} from "./DeploymentBannerView"

export default {
title: "components/DeploymentBannerView",
Expand Down
6 changes: 3 additions & 3 deletions site/src/components/DeploymentBanner/DeploymentBannerView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const DeploymentBannerView: FC<DeploymentBannerViewProps> = ({
return "just now"
}
return dayjs().to(dayjs(stats.collected_at))
// eslint-disable-next-line react-hooks/exhaustive-deps -- We want this to periodically update!
// eslint-disable-next-line react-hooks/exhaustive-deps -- We want this to periodically update!
}, [timeUntilRefresh, stats])

return (
Expand Down Expand Up @@ -145,7 +145,7 @@ export const DeploymentBannerView: FC<DeploymentBannerViewProps> = ({
>
<div className={styles.value}>
<LatencyIcon />
{displayLatency > 0 ? displayLatency?.toFixed(2) + "ms" : "-"}
{displayLatency > 0 ? displayLatency?.toFixed(2) + " ms" : "-"}
</div>
</Tooltip>
</div>
Expand Down Expand Up @@ -183,7 +183,7 @@ export const DeploymentBannerView: FC<DeploymentBannerViewProps> = ({
</div>
</div>
<div className={styles.refresh}>
<Tooltip title="The last time stats were aggregated">
<Tooltip title="The last time stats were aggregated. Workspaces report statistics periodically, so it may take a bit for these to update!">
<div className={styles.value}>
<CollectedIcon />
{lastAggregated}
Expand Down
2 changes: 1 addition & 1 deletion site/src/xServices/auth/authXService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const permissionsToCheck = {
object: {
resource_type: "deployment_stats",
},
action: "read",
action: "read",
},
} as const

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export const deploymentStatsMachine = createMachine(
data: DeploymentStats
}
},

},
tsTypes: {} as import("./deploymentStatsMachine.typegen").Typegen0,
initial: "stats",
Expand Down