Skip to content

Daily Active User Metrics #3735

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 28 commits into from
Sep 1, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
502aa52
agent: add ConnStats
ammario Aug 29, 2022
3893045
agent: add StatsReporter
ammario Aug 29, 2022
c03ad90
Frontend tests pass
ammario Sep 1, 2022
1bd9cec
Split DAUChart into its own file
ammario Sep 1, 2022
e46329b
Get FE tests passing with real data!
ammario Sep 1, 2022
d472b13
Test frontend
ammario Sep 1, 2022
e0295e0
Fix compilation error
ammario Sep 1, 2022
2f1a423
Rename ConnStats to StatsConn
ammario Sep 1, 2022
0a50cc9
continues instead of returns
ammario Sep 1, 2022
7feab5e
Fix some test failures
ammario Sep 1, 2022
a4d2cf7
Redo tests
ammario Sep 1, 2022
52c9d10
Address review comments
ammario Sep 1, 2022
3f9901e
REVAMP — backend tests work
ammario Sep 1, 2022
7840509
Black triangle
ammario Sep 1, 2022
39170cf
Consolidate template state machines
ammario Sep 1, 2022
eb373d6
Move workspaceagent endpoint
ammario Sep 1, 2022
a3d87b8
Address most review comments
ammario Sep 1, 2022
31ba0c6
Improve contrast in chart
ammario Sep 1, 2022
5b906c1
Add more agent tests
ammario Sep 1, 2022
49d9386
Fix JS ci
ammario Sep 1, 2022
b14a077
A bunch of minor touch ups
ammario Sep 1, 2022
8da24c4
Stabilize protoc
ammario Sep 1, 2022
00ec953
Merge remote-tracking branch 'origin/main' into metrics
ammario Sep 1, 2022
4940319
Update lockfile
ammario Sep 1, 2022
22b2028
Address comments + attempt to fix protoc
ammario Sep 1, 2022
0157365
fixup! Address comments + attempt to fix protoc
ammario Sep 1, 2022
b166cdd
Try to fix protoc...
ammario Sep 1, 2022
4201998
PROTO!
ammario Sep 1, 2022
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
Stabilize protoc
  • Loading branch information
ammario committed Sep 1, 2022
commit 8da24c48ccce52ab5e2188c8b33aea52fc7c071f
3 changes: 2 additions & 1 deletion .github/workflows/coder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ jobs:
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
version: "3.20.0"
# This must be in lockstep with our dogfood Dockerfile
version: "3.21.5"
- uses: actions/setup-go@v3
with:
go-version: "~1.19"
Expand Down
13 changes: 6 additions & 7 deletions agent/agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,14 @@ func TestAgent(t *testing.T) {
_, err = ptyConn.Write(data)
require.NoError(t, err)

require.Eventually(t, func() bool {
s, ok := (<-stats)
return ok && s.NumConns > 0
var s *agent.Stats
require.Eventuallyf(t, func() bool {
var ok bool
s, ok = (<-stats)
return ok && s.NumConns > 0 && s.RxBytes > 0 && s.TxBytes > 0
}, testutil.WaitShort, testutil.IntervalFast,
"never saw conn",
"never saw stats: %+v", s,
)
assert.EqualValues(t, 1, (<-stats).NumConns)
assert.Greater(t, (<-stats).RxBytes, int64(0))
assert.Greater(t, (<-stats).TxBytes, int64(0))
})
})
}
Expand Down
11 changes: 9 additions & 2 deletions dogfood/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ RUN mkdir --parents "$GOPATH" && \
# goimports for updating imports
go install golang.org/x/tools/cmd/goimports@v0.1.7 && \
# protoc-gen-go is needed to build sysbox from source
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.26 && \
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28 && \
# drpc support for v2
go install storj.io/drpc/cmd/protoc-gen-go-drpc@v0.0.26 && \
# migrate for migration support for v2
Expand Down Expand Up @@ -70,6 +70,12 @@ RUN mkdir --parents "$GOPATH" && \
# nfpm is used with `make build` to make release packages
go install github.com/goreleaser/nfpm/v2/cmd/nfpm@v2.16.0

FROM alpine:3.16 as proto
WORKDIR /tmp
RUN apk add curl unzip
RUN curl -L -o protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v21.5/protoc-21.5-linux-x86_64.zip
RUN unzip protoc.zip

# Ubuntu 20.04 LTS (Focal Fossa)
FROM ubuntu:focal

Expand Down Expand Up @@ -119,7 +125,6 @@ RUN apt-get update --quiet && apt-get install --yes \
openssh-server \
openssl \
pkg-config \
protobuf-compiler \
python3 \
python3-pip \
rsync \
Expand Down Expand Up @@ -156,6 +161,7 @@ RUN apt-get update --quiet && apt-get install --yes \
skopeo \
fish \
gh \
unzip \
zstd && \
# Delete package cache to avoid consuming space in layer
apt-get clean && \
Expand Down Expand Up @@ -300,6 +306,7 @@ RUN update-alternatives --install /usr/local/bin/gofmt gofmt /usr/local/go/bin/g

COPY --from=go /tmp/bin /usr/local/bin
COPY --from=rust-utils /tmp/bin /usr/local/bin
COPY --from=proto /tmp/bin /usr/local/bin

USER coder

Expand Down
4 changes: 2 additions & 2 deletions peerbroker/proto/peerbroker.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions provisionerd/proto/provisionerd.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions provisionersdk/proto/provisioner.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions site/src/api/typesGenerated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export interface AgentGitSSHKey {
readonly private_key: string
}

// From codersdk/metrics.go
// From codersdk/templates.go
export interface AgentStatsReportResponse {
readonly num_comms: number
readonly rx_bytes: number
Expand Down Expand Up @@ -182,7 +182,7 @@ export interface CreateWorkspaceRequest {
readonly parameter_values?: CreateParameterRequest[]
}

// From codersdk/metrics.go
// From codersdk/templates.go
export interface DAUEntry {
readonly date: string
readonly daus: number
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: DAUEntry.daus feels a bit weird. Would also prefer for us to use consistent casing if possible: DAU vs. dau

Maybe total?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The casing is an unfortunate side effect of the code generator, which is outside the scope of this PR. I can rename to total if you feel strongly, but I think daus is clear enough.

Expand Down Expand Up @@ -375,7 +375,7 @@ export interface Template {
readonly created_by_name: string
}

// From codersdk/metrics.go
// From codersdk/templates.go
export interface TemplateDAUsResponse {
readonly entries: DAUEntry[]
}
Expand Down