Commit Graph

23 Commits

Author SHA1 Message Date
Kyle Carberry 5abfe5afd0
chore: rename dbfake to dbmem (#10432) 2023-10-30 17:42:20 +00:00
Mathias Fredriksson 19d7da3d24
refactor(coderd/database): split `Time` and `Now` into `dbtime` package (#9482)
Ref: #9380
2023-09-01 16:50:12 +00:00
Kyle Carberry 22e781eced
chore: add /v2 to import module path (#9072)
* chore: add /v2 to import module path

go mod requires semantic versioning with versions greater than 1.x

This was a mechanical update by running:
```
go install github.com/marwan-at-work/mod/cmd/mod@latest
mod upgrade
```

Migrate generated files to import /v2

* Fix gen
2023-08-18 18:55:43 +00:00
Steven Masley de1a7a9210
chore: join user information to workspace_build and template_version (#8625)
* include minimial user on template version and build
* Add unit test to ensure join is superset
2023-07-25 09:14:38 -04:00
Steven Masley aceedefce3
chore: add `template_with_user` view to include user contextual data (#8568)
* chore: Refactor template sql queries to use new view
* TemplateWithUser -> Template
* Add unit test to enforce good view
2023-07-19 16:07:33 -04:00
Mathias Fredriksson 51226c55ab
test(coderd): close metricscache and avoid background context (#7996) 2023-06-13 20:18:31 +03:00
Steven Masley cf8d2bc096
feat: use tz_offset when doing deployment dau query (#7736)
* Have FE query correct tz_offset data
2023-06-01 09:23:50 -04:00
Steven Masley 73d795f426
chore: Revert to only using 1 timezone support for template DAUs (#7721)
* chore: Revert to only using 1 timezone support for template DAUs

Keeping the logic to support more in case we optimize later
2023-05-30 15:37:07 -04:00
Steven Masley c795a0e500
feat: Fix Deployment DAUs to work with local timezones (#7647)
* chore: Add timezone param to DAU SQL query
* Merge DAUs response
* Pass time offsets to metricscache
2023-05-30 13:18:27 -04:00
Kyle Carberry 5304b4e483
feat: add connection statistics for workspace agents (#6469)
* fix: don't make session counts cumulative

This made for some weird tracking... we want the point-in-time
number of counts!

* Add databasefake query for getting agent stats

* Add deployment stats endpoint

* The query... works?!?

* Fix aggregation query

* Select from multiple tables instead

* Fix continuous stats

* Increase period of stat refreshes

* Add workspace counts to deployment stats

* fmt

* Add a slight bit of responsiveness

* Fix template version editor overflow

* Add refresh button

* Fix font family on button

* Fix latest stat being reported

* Revert agent conn stats

* Fix linting error

* Fix tests

* Fix gen

* Fix migrations

* Block on sending stat updates

* Add test fixtures

* Fix response structure

* make gen
2023-03-08 21:05:45 -06:00
Kyle Carberry 87ed7a7dba
chore: use nil map on agent stats to check if report interval should be returned (#6479)
See https://github.com/coder/coder/actions/runs/4350638262/jobs/7601537088
2023-03-07 14:25:04 +00:00
Kyle Carberry 09f87d1df1
chore: remove empty case for metricscache (#6473)
This wasn't necessary to test and just caused flakes.
See: https://github.com/coder/coder/actions/runs/4350034299/jobs/7600340648
2023-03-06 21:13:08 -06:00
Kyle Carberry 05e449943d
chore: convert agent stats to use a table (#6374)
* chore: convert workspace agent stats from json to table

* chore: convert agent stats to use a table

Backwards compatibility becomes hard when all agent stats are in a JSON blob.
We also want to query this table for new agents that are failing health checks
so we can display it in the UI.

* Fix migration using default values
2023-02-28 13:33:33 -06:00
Steven Masley 8dba66c535
chore: Use dbgen in unit test (#6111)
* chore: Use dbgen in unit test

- organizationparam_test
- templateparam_test

* Use dbgen in all unit tests vs insert methods

* fixup! Use dbgen in all unit tests vs insert methods

---------

Co-authored-by: Cian Johnston <cian@coder.com>
2023-02-08 13:47:05 -06:00
Steven Masley 8b424f03c2
chore: Rename databasefake --> dbfake (#6011) 2023-02-02 19:28:55 -06:00
Mathias Fredriksson 8afdf24d10
chore: Update sqlc to v1.16.0 (#5788)
* chore: Update sqlc to v1.16.0

* chore: Fix cases where types became Null-types

* chore: Set parameter_schemas default_destination_scheme and default_source_scheme to NOT NULL

* chore: Add enum validation to database fake

* chore: Fix all tests that skipping enum values

* fix: Use correct err in providionerdserver audit log failure log
2023-01-23 13:14:47 +02:00
Ammar Bandukwala acf34d4295
site: support high build time variation in progress bar (#4941) 2022-11-17 16:56:56 +00:00
Ammar Bandukwala fa49ccd058
coderd/metricscache: fix test race (#4662) 2022-10-20 02:36:00 +00:00
Ammar Bandukwala 1984932dc9
coderd/metricscache: attempt to fix macOS race (#4622) 2022-10-18 17:28:40 +00:00
Ammar Bandukwala dc3519e973
Support all transitions in build progress bar (#4575)
* Use null types instead of -1 for simplicity

* Fix pgcrypto bug in migration 59

* Add stories

* Fix visual stutter
2022-10-16 23:34:03 -05:00
Ammar Bandukwala e456799f1a
Add template build time stats (#4557)
- Expose time in Template pages
- Show progress bar when building a workspace
2022-10-15 20:36:50 +00:00
Ammar Bandukwala f6aa025a01
feat: use active users instead of total users in Template views (#3900) 2022-09-09 19:30:31 +00:00
Ammar Bandukwala 30f8fd9b95
Daily Active User Metrics (#3735)
* agent: add StatsReporter

* Stabilize protoc
2022-09-01 14:58:23 -05:00