MCPcopy Index your code
hub / github.com/coder/coder / DeploymentDAUs

Method DeploymentDAUs

codersdk/deployment.go:5273–5288  ·  view source on GitHub ↗

DeploymentDAUs requires a tzOffset in hours. Use 0 for UTC, and TimezoneOffsetHour(time.Local) for the local timezone.

(ctx context.Context, tzOffset int)

Source from the content-addressed store, hash-verified

5271// DeploymentDAUs requires a tzOffset in hours. Use 0 for UTC, and TimezoneOffsetHour(time.Local) for the
5272// local timezone.
5273func (c *Client) DeploymentDAUs(ctx context.Context, tzOffset int) (*DAUsResponse, error) {
5274 res, err := c.Request(ctx, http.MethodGet, "/api/v2/insights/daus", nil, DAURequest{
5275 TZHourOffset: tzOffset,
5276 }.asRequestOption())
5277 if err != nil {
5278 return nil, xerrors.Errorf("execute request: %w", err)
5279 }
5280 defer res.Body.Close()
5281
5282 if res.StatusCode != http.StatusOK {
5283 return nil, ReadBodyAsError(res)
5284 }
5285
5286 var resp DAUsResponse
5287 return &resp, json.NewDecoder(res.Body).Decode(&resp)
5288}
5289
5290type AppHostResponse struct {
5291 // Host is the externally accessible URL for the Coder instance.

Callers 3

DeploymentDAUsLocalTZMethod · 0.95
TestDeploymentInsightsFunction · 0.80

Calls 5

RequestMethod · 0.95
ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65
asRequestOptionMethod · 0.45
ErrorfMethod · 0.45

Tested by 2

TestDeploymentInsightsFunction · 0.64