// Code generated by coderd/database/gen/metrics.
// Any function can be edited and will not be overwritten.
// New database functions are automatically generated!
package dbmetrics

import (
	"context"
	"database/sql"
	"time"

	"github.com/google/uuid"
	"github.com/prometheus/client_golang/prometheus"
	"golang.org/x/exp/slices"

	"github.com/coder/coder/v2/coderd/database"
	"github.com/coder/coder/v2/coderd/rbac"
)

var (
	// Force these imports, for some reason the autogen does not include them.
	_ uuid.UUID
	_ rbac.Action
)

const wrapname = "dbmetrics.metricsStore"

// New returns a database.Store that registers metrics for all queries to reg.
func New(s database.Store, reg prometheus.Registerer) database.Store {
	// Don't double-wrap.
	if slices.Contains(s.Wrappers(), wrapname) {
		return s
	}
	queryLatencies := prometheus.NewHistogramVec(prometheus.HistogramOpts{
		Namespace: "coderd",
		Subsystem: "db",
		Name:      "query_latencies_seconds",
		Help:      "Latency distribution of queries in seconds.",
		Buckets:   prometheus.DefBuckets,
	}, []string{"query"})
	txDuration := prometheus.NewHistogram(prometheus.HistogramOpts{
		Namespace: "coderd",
		Subsystem: "db",
		Name:      "tx_duration_seconds",
		Help:      "Duration of transactions in seconds.",
		Buckets:   prometheus.DefBuckets,
	})
	reg.MustRegister(queryLatencies)
	reg.MustRegister(txDuration)
	return &metricsStore{
		s:              s,
		queryLatencies: queryLatencies,
		txDuration:     txDuration,
	}
}

var _ database.Store = (*metricsStore)(nil)

type metricsStore struct {
	s              database.Store
	queryLatencies *prometheus.HistogramVec
	txDuration     prometheus.Histogram
}

func (m metricsStore) Wrappers() []string {
	return append(m.s.Wrappers(), wrapname)
}

func (m metricsStore) Ping(ctx context.Context) (time.Duration, error) {
	start := time.Now()
	duration, err := m.s.Ping(ctx)
	m.queryLatencies.WithLabelValues("Ping").Observe(time.Since(start).Seconds())
	return duration, err
}

func (m metricsStore) InTx(f func(database.Store) error, options *sql.TxOptions) error {
	start := time.Now()
	err := m.s.InTx(f, options)
	m.txDuration.Observe(time.Since(start).Seconds())
	return err
}

func (m metricsStore) AcquireLock(ctx context.Context, pgAdvisoryXactLock int64) error {
	start := time.Now()
	err := m.s.AcquireLock(ctx, pgAdvisoryXactLock)
	m.queryLatencies.WithLabelValues("AcquireLock").Observe(time.Since(start).Seconds())
	return err
}

func (m metricsStore) AcquireProvisionerJob(ctx context.Context, arg database.AcquireProvisionerJobParams) (database.ProvisionerJob, error) {
	start := time.Now()
	provisionerJob, err := m.s.AcquireProvisionerJob(ctx, arg)
	m.queryLatencies.WithLabelValues("AcquireProvisionerJob").Observe(time.Since(start).Seconds())
	return provisionerJob, err
}

func (m metricsStore) ActivityBumpWorkspace(ctx context.Context, arg database.ActivityBumpWorkspaceParams) error {
	start := time.Now()
	r0 := m.s.ActivityBumpWorkspace(ctx, arg)
	m.queryLatencies.WithLabelValues("ActivityBumpWorkspace").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) AllUserIDs(ctx context.Context) ([]uuid.UUID, error) {
	start := time.Now()
	r0, r1 := m.s.AllUserIDs(ctx)
	m.queryLatencies.WithLabelValues("AllUserIDs").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) ArchiveUnusedTemplateVersions(ctx context.Context, arg database.ArchiveUnusedTemplateVersionsParams) ([]uuid.UUID, error) {
	start := time.Now()
	r0, r1 := m.s.ArchiveUnusedTemplateVersions(ctx, arg)
	m.queryLatencies.WithLabelValues("ArchiveUnusedTemplateVersions").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) BatchUpdateWorkspaceLastUsedAt(ctx context.Context, arg database.BatchUpdateWorkspaceLastUsedAtParams) error {
	start := time.Now()
	r0 := m.s.BatchUpdateWorkspaceLastUsedAt(ctx, arg)
	m.queryLatencies.WithLabelValues("BatchUpdateWorkspaceLastUsedAt").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) CleanTailnetCoordinators(ctx context.Context) error {
	start := time.Now()
	err := m.s.CleanTailnetCoordinators(ctx)
	m.queryLatencies.WithLabelValues("CleanTailnetCoordinators").Observe(time.Since(start).Seconds())
	return err
}

func (m metricsStore) CleanTailnetLostPeers(ctx context.Context) error {
	start := time.Now()
	r0 := m.s.CleanTailnetLostPeers(ctx)
	m.queryLatencies.WithLabelValues("CleanTailnetLostPeers").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) CleanTailnetTunnels(ctx context.Context) error {
	start := time.Now()
	r0 := m.s.CleanTailnetTunnels(ctx)
	m.queryLatencies.WithLabelValues("CleanTailnetTunnels").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) DeleteAPIKeyByID(ctx context.Context, id string) error {
	start := time.Now()
	err := m.s.DeleteAPIKeyByID(ctx, id)
	m.queryLatencies.WithLabelValues("DeleteAPIKeyByID").Observe(time.Since(start).Seconds())
	return err
}

func (m metricsStore) DeleteAPIKeysByUserID(ctx context.Context, userID uuid.UUID) error {
	start := time.Now()
	err := m.s.DeleteAPIKeysByUserID(ctx, userID)
	m.queryLatencies.WithLabelValues("DeleteAPIKeysByUserID").Observe(time.Since(start).Seconds())
	return err
}

func (m metricsStore) DeleteAllTailnetClientSubscriptions(ctx context.Context, arg database.DeleteAllTailnetClientSubscriptionsParams) error {
	start := time.Now()
	r0 := m.s.DeleteAllTailnetClientSubscriptions(ctx, arg)
	m.queryLatencies.WithLabelValues("DeleteAllTailnetClientSubscriptions").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) DeleteAllTailnetTunnels(ctx context.Context, arg database.DeleteAllTailnetTunnelsParams) error {
	start := time.Now()
	r0 := m.s.DeleteAllTailnetTunnels(ctx, arg)
	m.queryLatencies.WithLabelValues("DeleteAllTailnetTunnels").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) DeleteApplicationConnectAPIKeysByUserID(ctx context.Context, userID uuid.UUID) error {
	start := time.Now()
	err := m.s.DeleteApplicationConnectAPIKeysByUserID(ctx, userID)
	m.queryLatencies.WithLabelValues("DeleteApplicationConnectAPIKeysByUserID").Observe(time.Since(start).Seconds())
	return err
}

func (m metricsStore) DeleteCoordinator(ctx context.Context, id uuid.UUID) error {
	start := time.Now()
	r0 := m.s.DeleteCoordinator(ctx, id)
	m.queryLatencies.WithLabelValues("DeleteCoordinator").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) DeleteExternalAuthLink(ctx context.Context, arg database.DeleteExternalAuthLinkParams) error {
	start := time.Now()
	r0 := m.s.DeleteExternalAuthLink(ctx, arg)
	m.queryLatencies.WithLabelValues("DeleteExternalAuthLink").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) DeleteGitSSHKey(ctx context.Context, userID uuid.UUID) error {
	start := time.Now()
	err := m.s.DeleteGitSSHKey(ctx, userID)
	m.queryLatencies.WithLabelValues("DeleteGitSSHKey").Observe(time.Since(start).Seconds())
	return err
}

func (m metricsStore) DeleteGroupByID(ctx context.Context, id uuid.UUID) error {
	start := time.Now()
	err := m.s.DeleteGroupByID(ctx, id)
	m.queryLatencies.WithLabelValues("DeleteGroupByID").Observe(time.Since(start).Seconds())
	return err
}

func (m metricsStore) DeleteGroupMemberFromGroup(ctx context.Context, arg database.DeleteGroupMemberFromGroupParams) error {
	start := time.Now()
	err := m.s.DeleteGroupMemberFromGroup(ctx, arg)
	m.queryLatencies.WithLabelValues("DeleteGroupMemberFromGroup").Observe(time.Since(start).Seconds())
	return err
}

func (m metricsStore) DeleteLicense(ctx context.Context, id int32) (int32, error) {
	start := time.Now()
	licenseID, err := m.s.DeleteLicense(ctx, id)
	m.queryLatencies.WithLabelValues("DeleteLicense").Observe(time.Since(start).Seconds())
	return licenseID, err
}

func (m metricsStore) DeleteOAuth2ProviderAppByID(ctx context.Context, id uuid.UUID) error {
	start := time.Now()
	r0 := m.s.DeleteOAuth2ProviderAppByID(ctx, id)
	m.queryLatencies.WithLabelValues("DeleteOAuth2ProviderAppByID").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) DeleteOAuth2ProviderAppCodeByID(ctx context.Context, id uuid.UUID) error {
	start := time.Now()
	r0 := m.s.DeleteOAuth2ProviderAppCodeByID(ctx, id)
	m.queryLatencies.WithLabelValues("DeleteOAuth2ProviderAppCodeByID").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) DeleteOAuth2ProviderAppCodesByAppAndUserID(ctx context.Context, arg database.DeleteOAuth2ProviderAppCodesByAppAndUserIDParams) error {
	start := time.Now()
	r0 := m.s.DeleteOAuth2ProviderAppCodesByAppAndUserID(ctx, arg)
	m.queryLatencies.WithLabelValues("DeleteOAuth2ProviderAppCodesByAppAndUserID").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) DeleteOAuth2ProviderAppSecretByID(ctx context.Context, id uuid.UUID) error {
	start := time.Now()
	r0 := m.s.DeleteOAuth2ProviderAppSecretByID(ctx, id)
	m.queryLatencies.WithLabelValues("DeleteOAuth2ProviderAppSecretByID").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) DeleteOAuth2ProviderAppTokensByAppAndUserID(ctx context.Context, arg database.DeleteOAuth2ProviderAppTokensByAppAndUserIDParams) error {
	start := time.Now()
	r0 := m.s.DeleteOAuth2ProviderAppTokensByAppAndUserID(ctx, arg)
	m.queryLatencies.WithLabelValues("DeleteOAuth2ProviderAppTokensByAppAndUserID").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) DeleteOldProvisionerDaemons(ctx context.Context) error {
	start := time.Now()
	r0 := m.s.DeleteOldProvisionerDaemons(ctx)
	m.queryLatencies.WithLabelValues("DeleteOldProvisionerDaemons").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) DeleteOldWorkspaceAgentLogs(ctx context.Context) error {
	start := time.Now()
	r0 := m.s.DeleteOldWorkspaceAgentLogs(ctx)
	m.queryLatencies.WithLabelValues("DeleteOldWorkspaceAgentLogs").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) DeleteOldWorkspaceAgentStats(ctx context.Context) error {
	start := time.Now()
	err := m.s.DeleteOldWorkspaceAgentStats(ctx)
	m.queryLatencies.WithLabelValues("DeleteOldWorkspaceAgentStats").Observe(time.Since(start).Seconds())
	return err
}

func (m metricsStore) DeleteReplicasUpdatedBefore(ctx context.Context, updatedAt time.Time) error {
	start := time.Now()
	err := m.s.DeleteReplicasUpdatedBefore(ctx, updatedAt)
	m.queryLatencies.WithLabelValues("DeleteReplicasUpdatedBefore").Observe(time.Since(start).Seconds())
	return err
}

func (m metricsStore) DeleteTailnetAgent(ctx context.Context, arg database.DeleteTailnetAgentParams) (database.DeleteTailnetAgentRow, error) {
	start := time.Now()
	r0, r1 := m.s.DeleteTailnetAgent(ctx, arg)
	m.queryLatencies.WithLabelValues("DeleteTailnetAgent").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) DeleteTailnetClient(ctx context.Context, arg database.DeleteTailnetClientParams) (database.DeleteTailnetClientRow, error) {
	start := time.Now()
	r0, r1 := m.s.DeleteTailnetClient(ctx, arg)
	m.queryLatencies.WithLabelValues("DeleteTailnetClient").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) DeleteTailnetClientSubscription(ctx context.Context, arg database.DeleteTailnetClientSubscriptionParams) error {
	start := time.Now()
	r0 := m.s.DeleteTailnetClientSubscription(ctx, arg)
	m.queryLatencies.WithLabelValues("DeleteTailnetClientSubscription").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) DeleteTailnetPeer(ctx context.Context, arg database.DeleteTailnetPeerParams) (database.DeleteTailnetPeerRow, error) {
	start := time.Now()
	r0, r1 := m.s.DeleteTailnetPeer(ctx, arg)
	m.queryLatencies.WithLabelValues("DeleteTailnetPeer").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) DeleteTailnetTunnel(ctx context.Context, arg database.DeleteTailnetTunnelParams) (database.DeleteTailnetTunnelRow, error) {
	start := time.Now()
	r0, r1 := m.s.DeleteTailnetTunnel(ctx, arg)
	m.queryLatencies.WithLabelValues("DeleteTailnetTunnel").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) DeleteWorkspaceAgentPortShare(ctx context.Context, arg database.DeleteWorkspaceAgentPortShareParams) error {
	start := time.Now()
	r0 := m.s.DeleteWorkspaceAgentPortShare(ctx, arg)
	m.queryLatencies.WithLabelValues("DeleteWorkspaceAgentPortShare").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) DeleteWorkspaceAgentPortSharesByTemplate(ctx context.Context, templateID uuid.UUID) error {
	start := time.Now()
	r0 := m.s.DeleteWorkspaceAgentPortSharesByTemplate(ctx, templateID)
	m.queryLatencies.WithLabelValues("DeleteWorkspaceAgentPortSharesByTemplate").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) FavoriteWorkspace(ctx context.Context, arg uuid.UUID) error {
	start := time.Now()
	r0 := m.s.FavoriteWorkspace(ctx, arg)
	m.queryLatencies.WithLabelValues("FavoriteWorkspace").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) GetAPIKeyByID(ctx context.Context, id string) (database.APIKey, error) {
	start := time.Now()
	apiKey, err := m.s.GetAPIKeyByID(ctx, id)
	m.queryLatencies.WithLabelValues("GetAPIKeyByID").Observe(time.Since(start).Seconds())
	return apiKey, err
}

func (m metricsStore) GetAPIKeyByName(ctx context.Context, arg database.GetAPIKeyByNameParams) (database.APIKey, error) {
	start := time.Now()
	apiKey, err := m.s.GetAPIKeyByName(ctx, arg)
	m.queryLatencies.WithLabelValues("GetAPIKeyByName").Observe(time.Since(start).Seconds())
	return apiKey, err
}

func (m metricsStore) GetAPIKeysByLoginType(ctx context.Context, loginType database.LoginType) ([]database.APIKey, error) {
	start := time.Now()
	apiKeys, err := m.s.GetAPIKeysByLoginType(ctx, loginType)
	m.queryLatencies.WithLabelValues("GetAPIKeysByLoginType").Observe(time.Since(start).Seconds())
	return apiKeys, err
}

func (m metricsStore) GetAPIKeysByUserID(ctx context.Context, arg database.GetAPIKeysByUserIDParams) ([]database.APIKey, error) {
	start := time.Now()
	apiKeys, err := m.s.GetAPIKeysByUserID(ctx, arg)
	m.queryLatencies.WithLabelValues("GetAPIKeysByUserID").Observe(time.Since(start).Seconds())
	return apiKeys, err
}

func (m metricsStore) GetAPIKeysLastUsedAfter(ctx context.Context, lastUsed time.Time) ([]database.APIKey, error) {
	start := time.Now()
	apiKeys, err := m.s.GetAPIKeysLastUsedAfter(ctx, lastUsed)
	m.queryLatencies.WithLabelValues("GetAPIKeysLastUsedAfter").Observe(time.Since(start).Seconds())
	return apiKeys, err
}

func (m metricsStore) GetActiveUserCount(ctx context.Context) (int64, error) {
	start := time.Now()
	count, err := m.s.GetActiveUserCount(ctx)
	m.queryLatencies.WithLabelValues("GetActiveUserCount").Observe(time.Since(start).Seconds())
	return count, err
}

func (m metricsStore) GetActiveWorkspaceBuildsByTemplateID(ctx context.Context, templateID uuid.UUID) ([]database.WorkspaceBuild, error) {
	start := time.Now()
	r0, r1 := m.s.GetActiveWorkspaceBuildsByTemplateID(ctx, templateID)
	m.queryLatencies.WithLabelValues("GetActiveWorkspaceBuildsByTemplateID").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetAllTailnetAgents(ctx context.Context) ([]database.TailnetAgent, error) {
	start := time.Now()
	r0, r1 := m.s.GetAllTailnetAgents(ctx)
	m.queryLatencies.WithLabelValues("GetAllTailnetAgents").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetAllTailnetCoordinators(ctx context.Context) ([]database.TailnetCoordinator, error) {
	start := time.Now()
	r0, r1 := m.s.GetAllTailnetCoordinators(ctx)
	m.queryLatencies.WithLabelValues("GetAllTailnetCoordinators").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetAllTailnetPeers(ctx context.Context) ([]database.TailnetPeer, error) {
	start := time.Now()
	r0, r1 := m.s.GetAllTailnetPeers(ctx)
	m.queryLatencies.WithLabelValues("GetAllTailnetPeers").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetAllTailnetTunnels(ctx context.Context) ([]database.TailnetTunnel, error) {
	start := time.Now()
	r0, r1 := m.s.GetAllTailnetTunnels(ctx)
	m.queryLatencies.WithLabelValues("GetAllTailnetTunnels").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetAppSecurityKey(ctx context.Context) (string, error) {
	start := time.Now()
	key, err := m.s.GetAppSecurityKey(ctx)
	m.queryLatencies.WithLabelValues("GetAppSecurityKey").Observe(time.Since(start).Seconds())
	return key, err
}

func (m metricsStore) GetApplicationName(ctx context.Context) (string, error) {
	start := time.Now()
	r0, r1 := m.s.GetApplicationName(ctx)
	m.queryLatencies.WithLabelValues("GetApplicationName").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetAuditLogsOffset(ctx context.Context, arg database.GetAuditLogsOffsetParams) ([]database.GetAuditLogsOffsetRow, error) {
	start := time.Now()
	rows, err := m.s.GetAuditLogsOffset(ctx, arg)
	m.queryLatencies.WithLabelValues("GetAuditLogsOffset").Observe(time.Since(start).Seconds())
	return rows, err
}

func (m metricsStore) GetAuthorizationUserRoles(ctx context.Context, userID uuid.UUID) (database.GetAuthorizationUserRolesRow, error) {
	start := time.Now()
	row, err := m.s.GetAuthorizationUserRoles(ctx, userID)
	m.queryLatencies.WithLabelValues("GetAuthorizationUserRoles").Observe(time.Since(start).Seconds())
	return row, err
}

func (m metricsStore) GetDBCryptKeys(ctx context.Context) ([]database.DBCryptKey, error) {
	start := time.Now()
	r0, r1 := m.s.GetDBCryptKeys(ctx)
	m.queryLatencies.WithLabelValues("GetDBCryptKeys").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetDERPMeshKey(ctx context.Context) (string, error) {
	start := time.Now()
	key, err := m.s.GetDERPMeshKey(ctx)
	m.queryLatencies.WithLabelValues("GetDERPMeshKey").Observe(time.Since(start).Seconds())
	return key, err
}

func (m metricsStore) GetDefaultOrganization(ctx context.Context) (database.Organization, error) {
	start := time.Now()
	r0, r1 := m.s.GetDefaultOrganization(ctx)
	m.queryLatencies.WithLabelValues("GetDefaultOrganization").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetDefaultProxyConfig(ctx context.Context) (database.GetDefaultProxyConfigRow, error) {
	start := time.Now()
	resp, err := m.s.GetDefaultProxyConfig(ctx)
	m.queryLatencies.WithLabelValues("GetDefaultProxyConfig").Observe(time.Since(start).Seconds())
	return resp, err
}

func (m metricsStore) GetDeploymentDAUs(ctx context.Context, tzOffset int32) ([]database.GetDeploymentDAUsRow, error) {
	start := time.Now()
	rows, err := m.s.GetDeploymentDAUs(ctx, tzOffset)
	m.queryLatencies.WithLabelValues("GetDeploymentDAUs").Observe(time.Since(start).Seconds())
	return rows, err
}

func (m metricsStore) GetDeploymentID(ctx context.Context) (string, error) {
	start := time.Now()
	id, err := m.s.GetDeploymentID(ctx)
	m.queryLatencies.WithLabelValues("GetDeploymentID").Observe(time.Since(start).Seconds())
	return id, err
}

func (m metricsStore) GetDeploymentWorkspaceAgentStats(ctx context.Context, createdAt time.Time) (database.GetDeploymentWorkspaceAgentStatsRow, error) {
	start := time.Now()
	row, err := m.s.GetDeploymentWorkspaceAgentStats(ctx, createdAt)
	m.queryLatencies.WithLabelValues("GetDeploymentWorkspaceAgentStats").Observe(time.Since(start).Seconds())
	return row, err
}

func (m metricsStore) GetDeploymentWorkspaceStats(ctx context.Context) (database.GetDeploymentWorkspaceStatsRow, error) {
	start := time.Now()
	row, err := m.s.GetDeploymentWorkspaceStats(ctx)
	m.queryLatencies.WithLabelValues("GetDeploymentWorkspaceStats").Observe(time.Since(start).Seconds())
	return row, err
}

func (m metricsStore) GetExternalAuthLink(ctx context.Context, arg database.GetExternalAuthLinkParams) (database.ExternalAuthLink, error) {
	start := time.Now()
	link, err := m.s.GetExternalAuthLink(ctx, arg)
	m.queryLatencies.WithLabelValues("GetExternalAuthLink").Observe(time.Since(start).Seconds())
	return link, err
}

func (m metricsStore) GetExternalAuthLinksByUserID(ctx context.Context, userID uuid.UUID) ([]database.ExternalAuthLink, error) {
	start := time.Now()
	r0, r1 := m.s.GetExternalAuthLinksByUserID(ctx, userID)
	m.queryLatencies.WithLabelValues("GetExternalAuthLinksByUserID").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetFileByHashAndCreator(ctx context.Context, arg database.GetFileByHashAndCreatorParams) (database.File, error) {
	start := time.Now()
	file, err := m.s.GetFileByHashAndCreator(ctx, arg)
	m.queryLatencies.WithLabelValues("GetFileByHashAndCreator").Observe(time.Since(start).Seconds())
	return file, err
}

func (m metricsStore) GetFileByID(ctx context.Context, id uuid.UUID) (database.File, error) {
	start := time.Now()
	file, err := m.s.GetFileByID(ctx, id)
	m.queryLatencies.WithLabelValues("GetFileByID").Observe(time.Since(start).Seconds())
	return file, err
}

func (m metricsStore) GetFileTemplates(ctx context.Context, fileID uuid.UUID) ([]database.GetFileTemplatesRow, error) {
	start := time.Now()
	rows, err := m.s.GetFileTemplates(ctx, fileID)
	m.queryLatencies.WithLabelValues("GetFileTemplates").Observe(time.Since(start).Seconds())
	return rows, err
}

func (m metricsStore) GetGitSSHKey(ctx context.Context, userID uuid.UUID) (database.GitSSHKey, error) {
	start := time.Now()
	key, err := m.s.GetGitSSHKey(ctx, userID)
	m.queryLatencies.WithLabelValues("GetGitSSHKey").Observe(time.Since(start).Seconds())
	return key, err
}

func (m metricsStore) GetGroupByID(ctx context.Context, id uuid.UUID) (database.Group, error) {
	start := time.Now()
	group, err := m.s.GetGroupByID(ctx, id)
	m.queryLatencies.WithLabelValues("GetGroupByID").Observe(time.Since(start).Seconds())
	return group, err
}

func (m metricsStore) GetGroupByOrgAndName(ctx context.Context, arg database.GetGroupByOrgAndNameParams) (database.Group, error) {
	start := time.Now()
	group, err := m.s.GetGroupByOrgAndName(ctx, arg)
	m.queryLatencies.WithLabelValues("GetGroupByOrgAndName").Observe(time.Since(start).Seconds())
	return group, err
}

func (m metricsStore) GetGroupMembers(ctx context.Context, groupID uuid.UUID) ([]database.User, error) {
	start := time.Now()
	users, err := m.s.GetGroupMembers(ctx, groupID)
	m.queryLatencies.WithLabelValues("GetGroupMembers").Observe(time.Since(start).Seconds())
	return users, err
}

func (m metricsStore) GetGroupsByOrganizationAndUserID(ctx context.Context, arg database.GetGroupsByOrganizationAndUserIDParams) ([]database.Group, error) {
	start := time.Now()
	r0, r1 := m.s.GetGroupsByOrganizationAndUserID(ctx, arg)
	m.queryLatencies.WithLabelValues("GetGroupsByOrganizationAndUserID").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetGroupsByOrganizationID(ctx context.Context, organizationID uuid.UUID) ([]database.Group, error) {
	start := time.Now()
	groups, err := m.s.GetGroupsByOrganizationID(ctx, organizationID)
	m.queryLatencies.WithLabelValues("GetGroupsByOrganizationID").Observe(time.Since(start).Seconds())
	return groups, err
}

func (m metricsStore) GetHealthSettings(ctx context.Context) (string, error) {
	start := time.Now()
	r0, r1 := m.s.GetHealthSettings(ctx)
	m.queryLatencies.WithLabelValues("GetHealthSettings").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetHungProvisionerJobs(ctx context.Context, hungSince time.Time) ([]database.ProvisionerJob, error) {
	start := time.Now()
	jobs, err := m.s.GetHungProvisionerJobs(ctx, hungSince)
	m.queryLatencies.WithLabelValues("GetHungProvisionerJobs").Observe(time.Since(start).Seconds())
	return jobs, err
}

func (m metricsStore) GetJFrogXrayScanByWorkspaceAndAgentID(ctx context.Context, arg database.GetJFrogXrayScanByWorkspaceAndAgentIDParams) (database.JfrogXrayScan, error) {
	start := time.Now()
	r0, r1 := m.s.GetJFrogXrayScanByWorkspaceAndAgentID(ctx, arg)
	m.queryLatencies.WithLabelValues("GetJFrogXrayScanByWorkspaceAndAgentID").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetLastUpdateCheck(ctx context.Context) (string, error) {
	start := time.Now()
	version, err := m.s.GetLastUpdateCheck(ctx)
	m.queryLatencies.WithLabelValues("GetLastUpdateCheck").Observe(time.Since(start).Seconds())
	return version, err
}

func (m metricsStore) GetLatestWorkspaceBuildByWorkspaceID(ctx context.Context, workspaceID uuid.UUID) (database.WorkspaceBuild, error) {
	start := time.Now()
	build, err := m.s.GetLatestWorkspaceBuildByWorkspaceID(ctx, workspaceID)
	m.queryLatencies.WithLabelValues("GetLatestWorkspaceBuildByWorkspaceID").Observe(time.Since(start).Seconds())
	return build, err
}

func (m metricsStore) GetLatestWorkspaceBuilds(ctx context.Context) ([]database.WorkspaceBuild, error) {
	start := time.Now()
	builds, err := m.s.GetLatestWorkspaceBuilds(ctx)
	m.queryLatencies.WithLabelValues("GetLatestWorkspaceBuilds").Observe(time.Since(start).Seconds())
	return builds, err
}

func (m metricsStore) GetLatestWorkspaceBuildsByWorkspaceIDs(ctx context.Context, ids []uuid.UUID) ([]database.WorkspaceBuild, error) {
	start := time.Now()
	builds, err := m.s.GetLatestWorkspaceBuildsByWorkspaceIDs(ctx, ids)
	m.queryLatencies.WithLabelValues("GetLatestWorkspaceBuildsByWorkspaceIDs").Observe(time.Since(start).Seconds())
	return builds, err
}

func (m metricsStore) GetLicenseByID(ctx context.Context, id int32) (database.License, error) {
	start := time.Now()
	license, err := m.s.GetLicenseByID(ctx, id)
	m.queryLatencies.WithLabelValues("GetLicenseByID").Observe(time.Since(start).Seconds())
	return license, err
}

func (m metricsStore) GetLicenses(ctx context.Context) ([]database.License, error) {
	start := time.Now()
	licenses, err := m.s.GetLicenses(ctx)
	m.queryLatencies.WithLabelValues("GetLicenses").Observe(time.Since(start).Seconds())
	return licenses, err
}

func (m metricsStore) GetLogoURL(ctx context.Context) (string, error) {
	start := time.Now()
	url, err := m.s.GetLogoURL(ctx)
	m.queryLatencies.WithLabelValues("GetLogoURL").Observe(time.Since(start).Seconds())
	return url, err
}

func (m metricsStore) GetOAuth2ProviderAppByID(ctx context.Context, id uuid.UUID) (database.OAuth2ProviderApp, error) {
	start := time.Now()
	r0, r1 := m.s.GetOAuth2ProviderAppByID(ctx, id)
	m.queryLatencies.WithLabelValues("GetOAuth2ProviderAppByID").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetOAuth2ProviderAppCodeByID(ctx context.Context, id uuid.UUID) (database.OAuth2ProviderAppCode, error) {
	start := time.Now()
	r0, r1 := m.s.GetOAuth2ProviderAppCodeByID(ctx, id)
	m.queryLatencies.WithLabelValues("GetOAuth2ProviderAppCodeByID").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetOAuth2ProviderAppCodeByPrefix(ctx context.Context, secretPrefix []byte) (database.OAuth2ProviderAppCode, error) {
	start := time.Now()
	r0, r1 := m.s.GetOAuth2ProviderAppCodeByPrefix(ctx, secretPrefix)
	m.queryLatencies.WithLabelValues("GetOAuth2ProviderAppCodeByPrefix").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetOAuth2ProviderAppSecretByID(ctx context.Context, id uuid.UUID) (database.OAuth2ProviderAppSecret, error) {
	start := time.Now()
	r0, r1 := m.s.GetOAuth2ProviderAppSecretByID(ctx, id)
	m.queryLatencies.WithLabelValues("GetOAuth2ProviderAppSecretByID").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetOAuth2ProviderAppSecretByPrefix(ctx context.Context, secretPrefix []byte) (database.OAuth2ProviderAppSecret, error) {
	start := time.Now()
	r0, r1 := m.s.GetOAuth2ProviderAppSecretByPrefix(ctx, secretPrefix)
	m.queryLatencies.WithLabelValues("GetOAuth2ProviderAppSecretByPrefix").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetOAuth2ProviderAppSecretsByAppID(ctx context.Context, appID uuid.UUID) ([]database.OAuth2ProviderAppSecret, error) {
	start := time.Now()
	r0, r1 := m.s.GetOAuth2ProviderAppSecretsByAppID(ctx, appID)
	m.queryLatencies.WithLabelValues("GetOAuth2ProviderAppSecretsByAppID").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetOAuth2ProviderAppTokenByPrefix(ctx context.Context, hashPrefix []byte) (database.OAuth2ProviderAppToken, error) {
	start := time.Now()
	r0, r1 := m.s.GetOAuth2ProviderAppTokenByPrefix(ctx, hashPrefix)
	m.queryLatencies.WithLabelValues("GetOAuth2ProviderAppTokenByPrefix").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetOAuth2ProviderApps(ctx context.Context) ([]database.OAuth2ProviderApp, error) {
	start := time.Now()
	r0, r1 := m.s.GetOAuth2ProviderApps(ctx)
	m.queryLatencies.WithLabelValues("GetOAuth2ProviderApps").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetOAuth2ProviderAppsByUserID(ctx context.Context, userID uuid.UUID) ([]database.GetOAuth2ProviderAppsByUserIDRow, error) {
	start := time.Now()
	r0, r1 := m.s.GetOAuth2ProviderAppsByUserID(ctx, userID)
	m.queryLatencies.WithLabelValues("GetOAuth2ProviderAppsByUserID").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetOAuthSigningKey(ctx context.Context) (string, error) {
	start := time.Now()
	r0, r1 := m.s.GetOAuthSigningKey(ctx)
	m.queryLatencies.WithLabelValues("GetOAuthSigningKey").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetOrganizationByID(ctx context.Context, id uuid.UUID) (database.Organization, error) {
	start := time.Now()
	organization, err := m.s.GetOrganizationByID(ctx, id)
	m.queryLatencies.WithLabelValues("GetOrganizationByID").Observe(time.Since(start).Seconds())
	return organization, err
}

func (m metricsStore) GetOrganizationByName(ctx context.Context, name string) (database.Organization, error) {
	start := time.Now()
	organization, err := m.s.GetOrganizationByName(ctx, name)
	m.queryLatencies.WithLabelValues("GetOrganizationByName").Observe(time.Since(start).Seconds())
	return organization, err
}

func (m metricsStore) GetOrganizationIDsByMemberIDs(ctx context.Context, ids []uuid.UUID) ([]database.GetOrganizationIDsByMemberIDsRow, error) {
	start := time.Now()
	organizations, err := m.s.GetOrganizationIDsByMemberIDs(ctx, ids)
	m.queryLatencies.WithLabelValues("GetOrganizationIDsByMemberIDs").Observe(time.Since(start).Seconds())
	return organizations, err
}

func (m metricsStore) GetOrganizationMemberByUserID(ctx context.Context, arg database.GetOrganizationMemberByUserIDParams) (database.OrganizationMember, error) {
	start := time.Now()
	member, err := m.s.GetOrganizationMemberByUserID(ctx, arg)
	m.queryLatencies.WithLabelValues("GetOrganizationMemberByUserID").Observe(time.Since(start).Seconds())
	return member, err
}

func (m metricsStore) GetOrganizationMembershipsByUserID(ctx context.Context, userID uuid.UUID) ([]database.OrganizationMember, error) {
	start := time.Now()
	memberships, err := m.s.GetOrganizationMembershipsByUserID(ctx, userID)
	m.queryLatencies.WithLabelValues("GetOrganizationMembershipsByUserID").Observe(time.Since(start).Seconds())
	return memberships, err
}

func (m metricsStore) GetOrganizations(ctx context.Context) ([]database.Organization, error) {
	start := time.Now()
	organizations, err := m.s.GetOrganizations(ctx)
	m.queryLatencies.WithLabelValues("GetOrganizations").Observe(time.Since(start).Seconds())
	return organizations, err
}

func (m metricsStore) GetOrganizationsByUserID(ctx context.Context, userID uuid.UUID) ([]database.Organization, error) {
	start := time.Now()
	organizations, err := m.s.GetOrganizationsByUserID(ctx, userID)
	m.queryLatencies.WithLabelValues("GetOrganizationsByUserID").Observe(time.Since(start).Seconds())
	return organizations, err
}

func (m metricsStore) GetParameterSchemasByJobID(ctx context.Context, jobID uuid.UUID) ([]database.ParameterSchema, error) {
	start := time.Now()
	schemas, err := m.s.GetParameterSchemasByJobID(ctx, jobID)
	m.queryLatencies.WithLabelValues("GetParameterSchemasByJobID").Observe(time.Since(start).Seconds())
	return schemas, err
}

func (m metricsStore) GetPreviousTemplateVersion(ctx context.Context, arg database.GetPreviousTemplateVersionParams) (database.TemplateVersion, error) {
	start := time.Now()
	version, err := m.s.GetPreviousTemplateVersion(ctx, arg)
	m.queryLatencies.WithLabelValues("GetPreviousTemplateVersion").Observe(time.Since(start).Seconds())
	return version, err
}

func (m metricsStore) GetProvisionerDaemons(ctx context.Context) ([]database.ProvisionerDaemon, error) {
	start := time.Now()
	daemons, err := m.s.GetProvisionerDaemons(ctx)
	m.queryLatencies.WithLabelValues("GetProvisionerDaemons").Observe(time.Since(start).Seconds())
	return daemons, err
}

func (m metricsStore) GetProvisionerJobByID(ctx context.Context, id uuid.UUID) (database.ProvisionerJob, error) {
	start := time.Now()
	job, err := m.s.GetProvisionerJobByID(ctx, id)
	m.queryLatencies.WithLabelValues("GetProvisionerJobByID").Observe(time.Since(start).Seconds())
	return job, err
}

func (m metricsStore) GetProvisionerJobsByIDs(ctx context.Context, ids []uuid.UUID) ([]database.ProvisionerJob, error) {
	start := time.Now()
	jobs, err := m.s.GetProvisionerJobsByIDs(ctx, ids)
	m.queryLatencies.WithLabelValues("GetProvisionerJobsByIDs").Observe(time.Since(start).Seconds())
	return jobs, err
}

func (m metricsStore) GetProvisionerJobsByIDsWithQueuePosition(ctx context.Context, ids []uuid.UUID) ([]database.GetProvisionerJobsByIDsWithQueuePositionRow, error) {
	start := time.Now()
	r0, r1 := m.s.GetProvisionerJobsByIDsWithQueuePosition(ctx, ids)
	m.queryLatencies.WithLabelValues("GetProvisionerJobsByIDsWithQueuePosition").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetProvisionerJobsCreatedAfter(ctx context.Context, createdAt time.Time) ([]database.ProvisionerJob, error) {
	start := time.Now()
	jobs, err := m.s.GetProvisionerJobsCreatedAfter(ctx, createdAt)
	m.queryLatencies.WithLabelValues("GetProvisionerJobsCreatedAfter").Observe(time.Since(start).Seconds())
	return jobs, err
}

func (m metricsStore) GetProvisionerLogsAfterID(ctx context.Context, arg database.GetProvisionerLogsAfterIDParams) ([]database.ProvisionerJobLog, error) {
	start := time.Now()
	logs, err := m.s.GetProvisionerLogsAfterID(ctx, arg)
	m.queryLatencies.WithLabelValues("GetProvisionerLogsAfterID").Observe(time.Since(start).Seconds())
	return logs, err
}

func (m metricsStore) GetQuotaAllowanceForUser(ctx context.Context, userID uuid.UUID) (int64, error) {
	start := time.Now()
	allowance, err := m.s.GetQuotaAllowanceForUser(ctx, userID)
	m.queryLatencies.WithLabelValues("GetQuotaAllowanceForUser").Observe(time.Since(start).Seconds())
	return allowance, err
}

func (m metricsStore) GetQuotaConsumedForUser(ctx context.Context, ownerID uuid.UUID) (int64, error) {
	start := time.Now()
	consumed, err := m.s.GetQuotaConsumedForUser(ctx, ownerID)
	m.queryLatencies.WithLabelValues("GetQuotaConsumedForUser").Observe(time.Since(start).Seconds())
	return consumed, err
}

func (m metricsStore) GetReplicaByID(ctx context.Context, id uuid.UUID) (database.Replica, error) {
	start := time.Now()
	replica, err := m.s.GetReplicaByID(ctx, id)
	m.queryLatencies.WithLabelValues("GetReplicaByID").Observe(time.Since(start).Seconds())
	return replica, err
}

func (m metricsStore) GetReplicasUpdatedAfter(ctx context.Context, updatedAt time.Time) ([]database.Replica, error) {
	start := time.Now()
	replicas, err := m.s.GetReplicasUpdatedAfter(ctx, updatedAt)
	m.queryLatencies.WithLabelValues("GetReplicasUpdatedAfter").Observe(time.Since(start).Seconds())
	return replicas, err
}

func (m metricsStore) GetServiceBanner(ctx context.Context) (string, error) {
	start := time.Now()
	banner, err := m.s.GetServiceBanner(ctx)
	m.queryLatencies.WithLabelValues("GetServiceBanner").Observe(time.Since(start).Seconds())
	return banner, err
}

func (m metricsStore) GetTailnetAgents(ctx context.Context, id uuid.UUID) ([]database.TailnetAgent, error) {
	start := time.Now()
	r0, r1 := m.s.GetTailnetAgents(ctx, id)
	m.queryLatencies.WithLabelValues("GetTailnetAgents").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetTailnetClientsForAgent(ctx context.Context, agentID uuid.UUID) ([]database.TailnetClient, error) {
	start := time.Now()
	r0, r1 := m.s.GetTailnetClientsForAgent(ctx, agentID)
	m.queryLatencies.WithLabelValues("GetTailnetClientsForAgent").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetTailnetPeers(ctx context.Context, id uuid.UUID) ([]database.TailnetPeer, error) {
	start := time.Now()
	r0, r1 := m.s.GetTailnetPeers(ctx, id)
	m.queryLatencies.WithLabelValues("GetTailnetPeers").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetTailnetTunnelPeerBindings(ctx context.Context, srcID uuid.UUID) ([]database.GetTailnetTunnelPeerBindingsRow, error) {
	start := time.Now()
	r0, r1 := m.s.GetTailnetTunnelPeerBindings(ctx, srcID)
	m.queryLatencies.WithLabelValues("GetTailnetTunnelPeerBindings").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetTailnetTunnelPeerIDs(ctx context.Context, srcID uuid.UUID) ([]database.GetTailnetTunnelPeerIDsRow, error) {
	start := time.Now()
	r0, r1 := m.s.GetTailnetTunnelPeerIDs(ctx, srcID)
	m.queryLatencies.WithLabelValues("GetTailnetTunnelPeerIDs").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetTemplateAppInsights(ctx context.Context, arg database.GetTemplateAppInsightsParams) ([]database.GetTemplateAppInsightsRow, error) {
	start := time.Now()
	r0, r1 := m.s.GetTemplateAppInsights(ctx, arg)
	m.queryLatencies.WithLabelValues("GetTemplateAppInsights").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetTemplateAppInsightsByTemplate(ctx context.Context, arg database.GetTemplateAppInsightsByTemplateParams) ([]database.GetTemplateAppInsightsByTemplateRow, error) {
	start := time.Now()
	r0, r1 := m.s.GetTemplateAppInsightsByTemplate(ctx, arg)
	m.queryLatencies.WithLabelValues("GetTemplateAppInsightsByTemplate").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetTemplateAverageBuildTime(ctx context.Context, arg database.GetTemplateAverageBuildTimeParams) (database.GetTemplateAverageBuildTimeRow, error) {
	start := time.Now()
	buildTime, err := m.s.GetTemplateAverageBuildTime(ctx, arg)
	m.queryLatencies.WithLabelValues("GetTemplateAverageBuildTime").Observe(time.Since(start).Seconds())
	return buildTime, err
}

func (m metricsStore) GetTemplateByID(ctx context.Context, id uuid.UUID) (database.Template, error) {
	start := time.Now()
	template, err := m.s.GetTemplateByID(ctx, id)
	m.queryLatencies.WithLabelValues("GetTemplateByID").Observe(time.Since(start).Seconds())
	return template, err
}

func (m metricsStore) GetTemplateByOrganizationAndName(ctx context.Context, arg database.GetTemplateByOrganizationAndNameParams) (database.Template, error) {
	start := time.Now()
	template, err := m.s.GetTemplateByOrganizationAndName(ctx, arg)
	m.queryLatencies.WithLabelValues("GetTemplateByOrganizationAndName").Observe(time.Since(start).Seconds())
	return template, err
}

func (m metricsStore) GetTemplateDAUs(ctx context.Context, arg database.GetTemplateDAUsParams) ([]database.GetTemplateDAUsRow, error) {
	start := time.Now()
	daus, err := m.s.GetTemplateDAUs(ctx, arg)
	m.queryLatencies.WithLabelValues("GetTemplateDAUs").Observe(time.Since(start).Seconds())
	return daus, err
}

func (m metricsStore) GetTemplateInsights(ctx context.Context, arg database.GetTemplateInsightsParams) (database.GetTemplateInsightsRow, error) {
	start := time.Now()
	r0, r1 := m.s.GetTemplateInsights(ctx, arg)
	m.queryLatencies.WithLabelValues("GetTemplateInsights").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetTemplateInsightsByInterval(ctx context.Context, arg database.GetTemplateInsightsByIntervalParams) ([]database.GetTemplateInsightsByIntervalRow, error) {
	start := time.Now()
	r0, r1 := m.s.GetTemplateInsightsByInterval(ctx, arg)
	m.queryLatencies.WithLabelValues("GetTemplateInsightsByInterval").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetTemplateInsightsByTemplate(ctx context.Context, arg database.GetTemplateInsightsByTemplateParams) ([]database.GetTemplateInsightsByTemplateRow, error) {
	start := time.Now()
	r0, r1 := m.s.GetTemplateInsightsByTemplate(ctx, arg)
	m.queryLatencies.WithLabelValues("GetTemplateInsightsByTemplate").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetTemplateParameterInsights(ctx context.Context, arg database.GetTemplateParameterInsightsParams) ([]database.GetTemplateParameterInsightsRow, error) {
	start := time.Now()
	r0, r1 := m.s.GetTemplateParameterInsights(ctx, arg)
	m.queryLatencies.WithLabelValues("GetTemplateParameterInsights").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetTemplateUsageStats(ctx context.Context, arg database.GetTemplateUsageStatsParams) ([]database.TemplateUsageStat, error) {
	start := time.Now()
	r0, r1 := m.s.GetTemplateUsageStats(ctx, arg)
	m.queryLatencies.WithLabelValues("GetTemplateUsageStats").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetTemplateVersionByID(ctx context.Context, id uuid.UUID) (database.TemplateVersion, error) {
	start := time.Now()
	version, err := m.s.GetTemplateVersionByID(ctx, id)
	m.queryLatencies.WithLabelValues("GetTemplateVersionByID").Observe(time.Since(start).Seconds())
	return version, err
}

func (m metricsStore) GetTemplateVersionByJobID(ctx context.Context, jobID uuid.UUID) (database.TemplateVersion, error) {
	start := time.Now()
	version, err := m.s.GetTemplateVersionByJobID(ctx, jobID)
	m.queryLatencies.WithLabelValues("GetTemplateVersionByJobID").Observe(time.Since(start).Seconds())
	return version, err
}

func (m metricsStore) GetTemplateVersionByTemplateIDAndName(ctx context.Context, arg database.GetTemplateVersionByTemplateIDAndNameParams) (database.TemplateVersion, error) {
	start := time.Now()
	version, err := m.s.GetTemplateVersionByTemplateIDAndName(ctx, arg)
	m.queryLatencies.WithLabelValues("GetTemplateVersionByTemplateIDAndName").Observe(time.Since(start).Seconds())
	return version, err
}

func (m metricsStore) GetTemplateVersionParameters(ctx context.Context, templateVersionID uuid.UUID) ([]database.TemplateVersionParameter, error) {
	start := time.Now()
	parameters, err := m.s.GetTemplateVersionParameters(ctx, templateVersionID)
	m.queryLatencies.WithLabelValues("GetTemplateVersionParameters").Observe(time.Since(start).Seconds())
	return parameters, err
}

func (m metricsStore) GetTemplateVersionVariables(ctx context.Context, templateVersionID uuid.UUID) ([]database.TemplateVersionVariable, error) {
	start := time.Now()
	variables, err := m.s.GetTemplateVersionVariables(ctx, templateVersionID)
	m.queryLatencies.WithLabelValues("GetTemplateVersionVariables").Observe(time.Since(start).Seconds())
	return variables, err
}

func (m metricsStore) GetTemplateVersionsByIDs(ctx context.Context, ids []uuid.UUID) ([]database.TemplateVersion, error) {
	start := time.Now()
	versions, err := m.s.GetTemplateVersionsByIDs(ctx, ids)
	m.queryLatencies.WithLabelValues("GetTemplateVersionsByIDs").Observe(time.Since(start).Seconds())
	return versions, err
}

func (m metricsStore) GetTemplateVersionsByTemplateID(ctx context.Context, arg database.GetTemplateVersionsByTemplateIDParams) ([]database.TemplateVersion, error) {
	start := time.Now()
	versions, err := m.s.GetTemplateVersionsByTemplateID(ctx, arg)
	m.queryLatencies.WithLabelValues("GetTemplateVersionsByTemplateID").Observe(time.Since(start).Seconds())
	return versions, err
}

func (m metricsStore) GetTemplateVersionsCreatedAfter(ctx context.Context, createdAt time.Time) ([]database.TemplateVersion, error) {
	start := time.Now()
	versions, err := m.s.GetTemplateVersionsCreatedAfter(ctx, createdAt)
	m.queryLatencies.WithLabelValues("GetTemplateVersionsCreatedAfter").Observe(time.Since(start).Seconds())
	return versions, err
}

func (m metricsStore) GetTemplates(ctx context.Context) ([]database.Template, error) {
	start := time.Now()
	templates, err := m.s.GetTemplates(ctx)
	m.queryLatencies.WithLabelValues("GetTemplates").Observe(time.Since(start).Seconds())
	return templates, err
}

func (m metricsStore) GetTemplatesWithFilter(ctx context.Context, arg database.GetTemplatesWithFilterParams) ([]database.Template, error) {
	start := time.Now()
	templates, err := m.s.GetTemplatesWithFilter(ctx, arg)
	m.queryLatencies.WithLabelValues("GetTemplatesWithFilter").Observe(time.Since(start).Seconds())
	return templates, err
}

func (m metricsStore) GetUnexpiredLicenses(ctx context.Context) ([]database.License, error) {
	start := time.Now()
	licenses, err := m.s.GetUnexpiredLicenses(ctx)
	m.queryLatencies.WithLabelValues("GetUnexpiredLicenses").Observe(time.Since(start).Seconds())
	return licenses, err
}

func (m metricsStore) GetUserActivityInsights(ctx context.Context, arg database.GetUserActivityInsightsParams) ([]database.GetUserActivityInsightsRow, error) {
	start := time.Now()
	r0, r1 := m.s.GetUserActivityInsights(ctx, arg)
	m.queryLatencies.WithLabelValues("GetUserActivityInsights").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetUserByEmailOrUsername(ctx context.Context, arg database.GetUserByEmailOrUsernameParams) (database.User, error) {
	start := time.Now()
	user, err := m.s.GetUserByEmailOrUsername(ctx, arg)
	m.queryLatencies.WithLabelValues("GetUserByEmailOrUsername").Observe(time.Since(start).Seconds())
	return user, err
}

func (m metricsStore) GetUserByID(ctx context.Context, id uuid.UUID) (database.User, error) {
	start := time.Now()
	user, err := m.s.GetUserByID(ctx, id)
	m.queryLatencies.WithLabelValues("GetUserByID").Observe(time.Since(start).Seconds())
	return user, err
}

func (m metricsStore) GetUserCount(ctx context.Context) (int64, error) {
	start := time.Now()
	count, err := m.s.GetUserCount(ctx)
	m.queryLatencies.WithLabelValues("GetUserCount").Observe(time.Since(start).Seconds())
	return count, err
}

func (m metricsStore) GetUserLatencyInsights(ctx context.Context, arg database.GetUserLatencyInsightsParams) ([]database.GetUserLatencyInsightsRow, error) {
	start := time.Now()
	r0, r1 := m.s.GetUserLatencyInsights(ctx, arg)
	m.queryLatencies.WithLabelValues("GetUserLatencyInsights").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetUserLinkByLinkedID(ctx context.Context, linkedID string) (database.UserLink, error) {
	start := time.Now()
	link, err := m.s.GetUserLinkByLinkedID(ctx, linkedID)
	m.queryLatencies.WithLabelValues("GetUserLinkByLinkedID").Observe(time.Since(start).Seconds())
	return link, err
}

func (m metricsStore) GetUserLinkByUserIDLoginType(ctx context.Context, arg database.GetUserLinkByUserIDLoginTypeParams) (database.UserLink, error) {
	start := time.Now()
	link, err := m.s.GetUserLinkByUserIDLoginType(ctx, arg)
	m.queryLatencies.WithLabelValues("GetUserLinkByUserIDLoginType").Observe(time.Since(start).Seconds())
	return link, err
}

func (m metricsStore) GetUserLinksByUserID(ctx context.Context, userID uuid.UUID) ([]database.UserLink, error) {
	start := time.Now()
	r0, r1 := m.s.GetUserLinksByUserID(ctx, userID)
	m.queryLatencies.WithLabelValues("GetUserLinksByUserID").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetUserWorkspaceBuildParameters(ctx context.Context, ownerID database.GetUserWorkspaceBuildParametersParams) ([]database.GetUserWorkspaceBuildParametersRow, error) {
	start := time.Now()
	r0, r1 := m.s.GetUserWorkspaceBuildParameters(ctx, ownerID)
	m.queryLatencies.WithLabelValues("GetUserWorkspaceBuildParameters").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetUsers(ctx context.Context, arg database.GetUsersParams) ([]database.GetUsersRow, error) {
	start := time.Now()
	users, err := m.s.GetUsers(ctx, arg)
	m.queryLatencies.WithLabelValues("GetUsers").Observe(time.Since(start).Seconds())
	return users, err
}

func (m metricsStore) GetUsersByIDs(ctx context.Context, ids []uuid.UUID) ([]database.User, error) {
	start := time.Now()
	users, err := m.s.GetUsersByIDs(ctx, ids)
	m.queryLatencies.WithLabelValues("GetUsersByIDs").Observe(time.Since(start).Seconds())
	return users, err
}

func (m metricsStore) GetWorkspaceAgentAndLatestBuildByAuthToken(ctx context.Context, authToken uuid.UUID) (database.GetWorkspaceAgentAndLatestBuildByAuthTokenRow, error) {
	start := time.Now()
	r0, r1 := m.s.GetWorkspaceAgentAndLatestBuildByAuthToken(ctx, authToken)
	m.queryLatencies.WithLabelValues("GetWorkspaceAgentAndLatestBuildByAuthToken").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetWorkspaceAgentByID(ctx context.Context, id uuid.UUID) (database.WorkspaceAgent, error) {
	start := time.Now()
	agent, err := m.s.GetWorkspaceAgentByID(ctx, id)
	m.queryLatencies.WithLabelValues("GetWorkspaceAgentByID").Observe(time.Since(start).Seconds())
	return agent, err
}

func (m metricsStore) GetWorkspaceAgentByInstanceID(ctx context.Context, authInstanceID string) (database.WorkspaceAgent, error) {
	start := time.Now()
	agent, err := m.s.GetWorkspaceAgentByInstanceID(ctx, authInstanceID)
	m.queryLatencies.WithLabelValues("GetWorkspaceAgentByInstanceID").Observe(time.Since(start).Seconds())
	return agent, err
}

func (m metricsStore) GetWorkspaceAgentLifecycleStateByID(ctx context.Context, id uuid.UUID) (database.GetWorkspaceAgentLifecycleStateByIDRow, error) {
	start := time.Now()
	r0, r1 := m.s.GetWorkspaceAgentLifecycleStateByID(ctx, id)
	m.queryLatencies.WithLabelValues("GetWorkspaceAgentLifecycleStateByID").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetWorkspaceAgentLogSourcesByAgentIDs(ctx context.Context, ids []uuid.UUID) ([]database.WorkspaceAgentLogSource, error) {
	start := time.Now()
	r0, r1 := m.s.GetWorkspaceAgentLogSourcesByAgentIDs(ctx, ids)
	m.queryLatencies.WithLabelValues("GetWorkspaceAgentLogSourcesByAgentIDs").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetWorkspaceAgentLogsAfter(ctx context.Context, arg database.GetWorkspaceAgentLogsAfterParams) ([]database.WorkspaceAgentLog, error) {
	start := time.Now()
	r0, r1 := m.s.GetWorkspaceAgentLogsAfter(ctx, arg)
	m.queryLatencies.WithLabelValues("GetWorkspaceAgentLogsAfter").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetWorkspaceAgentMetadata(ctx context.Context, workspaceAgentID database.GetWorkspaceAgentMetadataParams) ([]database.WorkspaceAgentMetadatum, error) {
	start := time.Now()
	metadata, err := m.s.GetWorkspaceAgentMetadata(ctx, workspaceAgentID)
	m.queryLatencies.WithLabelValues("GetWorkspaceAgentMetadata").Observe(time.Since(start).Seconds())
	return metadata, err
}

func (m metricsStore) GetWorkspaceAgentPortShare(ctx context.Context, arg database.GetWorkspaceAgentPortShareParams) (database.WorkspaceAgentPortShare, error) {
	start := time.Now()
	r0, r1 := m.s.GetWorkspaceAgentPortShare(ctx, arg)
	m.queryLatencies.WithLabelValues("GetWorkspaceAgentPortShare").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetWorkspaceAgentScriptsByAgentIDs(ctx context.Context, ids []uuid.UUID) ([]database.WorkspaceAgentScript, error) {
	start := time.Now()
	r0, r1 := m.s.GetWorkspaceAgentScriptsByAgentIDs(ctx, ids)
	m.queryLatencies.WithLabelValues("GetWorkspaceAgentScriptsByAgentIDs").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetWorkspaceAgentStats(ctx context.Context, createdAt time.Time) ([]database.GetWorkspaceAgentStatsRow, error) {
	start := time.Now()
	stats, err := m.s.GetWorkspaceAgentStats(ctx, createdAt)
	m.queryLatencies.WithLabelValues("GetWorkspaceAgentStats").Observe(time.Since(start).Seconds())
	return stats, err
}

func (m metricsStore) GetWorkspaceAgentStatsAndLabels(ctx context.Context, createdAt time.Time) ([]database.GetWorkspaceAgentStatsAndLabelsRow, error) {
	start := time.Now()
	stats, err := m.s.GetWorkspaceAgentStatsAndLabels(ctx, createdAt)
	m.queryLatencies.WithLabelValues("GetWorkspaceAgentStatsAndLabels").Observe(time.Since(start).Seconds())
	return stats, err
}

func (m metricsStore) GetWorkspaceAgentsByResourceIDs(ctx context.Context, ids []uuid.UUID) ([]database.WorkspaceAgent, error) {
	start := time.Now()
	agents, err := m.s.GetWorkspaceAgentsByResourceIDs(ctx, ids)
	m.queryLatencies.WithLabelValues("GetWorkspaceAgentsByResourceIDs").Observe(time.Since(start).Seconds())
	return agents, err
}

func (m metricsStore) GetWorkspaceAgentsCreatedAfter(ctx context.Context, createdAt time.Time) ([]database.WorkspaceAgent, error) {
	start := time.Now()
	agents, err := m.s.GetWorkspaceAgentsCreatedAfter(ctx, createdAt)
	m.queryLatencies.WithLabelValues("GetWorkspaceAgentsCreatedAfter").Observe(time.Since(start).Seconds())
	return agents, err
}

func (m metricsStore) GetWorkspaceAgentsInLatestBuildByWorkspaceID(ctx context.Context, workspaceID uuid.UUID) ([]database.WorkspaceAgent, error) {
	start := time.Now()
	agents, err := m.s.GetWorkspaceAgentsInLatestBuildByWorkspaceID(ctx, workspaceID)
	m.queryLatencies.WithLabelValues("GetWorkspaceAgentsInLatestBuildByWorkspaceID").Observe(time.Since(start).Seconds())
	return agents, err
}

func (m metricsStore) GetWorkspaceAppByAgentIDAndSlug(ctx context.Context, arg database.GetWorkspaceAppByAgentIDAndSlugParams) (database.WorkspaceApp, error) {
	start := time.Now()
	app, err := m.s.GetWorkspaceAppByAgentIDAndSlug(ctx, arg)
	m.queryLatencies.WithLabelValues("GetWorkspaceAppByAgentIDAndSlug").Observe(time.Since(start).Seconds())
	return app, err
}

func (m metricsStore) GetWorkspaceAppsByAgentID(ctx context.Context, agentID uuid.UUID) ([]database.WorkspaceApp, error) {
	start := time.Now()
	apps, err := m.s.GetWorkspaceAppsByAgentID(ctx, agentID)
	m.queryLatencies.WithLabelValues("GetWorkspaceAppsByAgentID").Observe(time.Since(start).Seconds())
	return apps, err
}

func (m metricsStore) GetWorkspaceAppsByAgentIDs(ctx context.Context, ids []uuid.UUID) ([]database.WorkspaceApp, error) {
	start := time.Now()
	apps, err := m.s.GetWorkspaceAppsByAgentIDs(ctx, ids)
	m.queryLatencies.WithLabelValues("GetWorkspaceAppsByAgentIDs").Observe(time.Since(start).Seconds())
	return apps, err
}

func (m metricsStore) GetWorkspaceAppsCreatedAfter(ctx context.Context, createdAt time.Time) ([]database.WorkspaceApp, error) {
	start := time.Now()
	apps, err := m.s.GetWorkspaceAppsCreatedAfter(ctx, createdAt)
	m.queryLatencies.WithLabelValues("GetWorkspaceAppsCreatedAfter").Observe(time.Since(start).Seconds())
	return apps, err
}

func (m metricsStore) GetWorkspaceBuildByID(ctx context.Context, id uuid.UUID) (database.WorkspaceBuild, error) {
	start := time.Now()
	build, err := m.s.GetWorkspaceBuildByID(ctx, id)
	m.queryLatencies.WithLabelValues("GetWorkspaceBuildByID").Observe(time.Since(start).Seconds())
	return build, err
}

func (m metricsStore) GetWorkspaceBuildByJobID(ctx context.Context, jobID uuid.UUID) (database.WorkspaceBuild, error) {
	start := time.Now()
	build, err := m.s.GetWorkspaceBuildByJobID(ctx, jobID)
	m.queryLatencies.WithLabelValues("GetWorkspaceBuildByJobID").Observe(time.Since(start).Seconds())
	return build, err
}

func (m metricsStore) GetWorkspaceBuildByWorkspaceIDAndBuildNumber(ctx context.Context, arg database.GetWorkspaceBuildByWorkspaceIDAndBuildNumberParams) (database.WorkspaceBuild, error) {
	start := time.Now()
	build, err := m.s.GetWorkspaceBuildByWorkspaceIDAndBuildNumber(ctx, arg)
	m.queryLatencies.WithLabelValues("GetWorkspaceBuildByWorkspaceIDAndBuildNumber").Observe(time.Since(start).Seconds())
	return build, err
}

func (m metricsStore) GetWorkspaceBuildParameters(ctx context.Context, workspaceBuildID uuid.UUID) ([]database.WorkspaceBuildParameter, error) {
	start := time.Now()
	params, err := m.s.GetWorkspaceBuildParameters(ctx, workspaceBuildID)
	m.queryLatencies.WithLabelValues("GetWorkspaceBuildParameters").Observe(time.Since(start).Seconds())
	return params, err
}

func (m metricsStore) GetWorkspaceBuildsByWorkspaceID(ctx context.Context, arg database.GetWorkspaceBuildsByWorkspaceIDParams) ([]database.WorkspaceBuild, error) {
	start := time.Now()
	builds, err := m.s.GetWorkspaceBuildsByWorkspaceID(ctx, arg)
	m.queryLatencies.WithLabelValues("GetWorkspaceBuildsByWorkspaceID").Observe(time.Since(start).Seconds())
	return builds, err
}

func (m metricsStore) GetWorkspaceBuildsCreatedAfter(ctx context.Context, createdAt time.Time) ([]database.WorkspaceBuild, error) {
	start := time.Now()
	builds, err := m.s.GetWorkspaceBuildsCreatedAfter(ctx, createdAt)
	m.queryLatencies.WithLabelValues("GetWorkspaceBuildsCreatedAfter").Observe(time.Since(start).Seconds())
	return builds, err
}

func (m metricsStore) GetWorkspaceByAgentID(ctx context.Context, agentID uuid.UUID) (database.GetWorkspaceByAgentIDRow, error) {
	start := time.Now()
	workspace, err := m.s.GetWorkspaceByAgentID(ctx, agentID)
	m.queryLatencies.WithLabelValues("GetWorkspaceByAgentID").Observe(time.Since(start).Seconds())
	return workspace, err
}

func (m metricsStore) GetWorkspaceByID(ctx context.Context, id uuid.UUID) (database.Workspace, error) {
	start := time.Now()
	workspace, err := m.s.GetWorkspaceByID(ctx, id)
	m.queryLatencies.WithLabelValues("GetWorkspaceByID").Observe(time.Since(start).Seconds())
	return workspace, err
}

func (m metricsStore) GetWorkspaceByOwnerIDAndName(ctx context.Context, arg database.GetWorkspaceByOwnerIDAndNameParams) (database.Workspace, error) {
	start := time.Now()
	workspace, err := m.s.GetWorkspaceByOwnerIDAndName(ctx, arg)
	m.queryLatencies.WithLabelValues("GetWorkspaceByOwnerIDAndName").Observe(time.Since(start).Seconds())
	return workspace, err
}

func (m metricsStore) GetWorkspaceByWorkspaceAppID(ctx context.Context, workspaceAppID uuid.UUID) (database.Workspace, error) {
	start := time.Now()
	workspace, err := m.s.GetWorkspaceByWorkspaceAppID(ctx, workspaceAppID)
	m.queryLatencies.WithLabelValues("GetWorkspaceByWorkspaceAppID").Observe(time.Since(start).Seconds())
	return workspace, err
}

func (m metricsStore) GetWorkspaceProxies(ctx context.Context) ([]database.WorkspaceProxy, error) {
	start := time.Now()
	proxies, err := m.s.GetWorkspaceProxies(ctx)
	m.queryLatencies.WithLabelValues("GetWorkspaceProxies").Observe(time.Since(start).Seconds())
	return proxies, err
}

func (m metricsStore) GetWorkspaceProxyByHostname(ctx context.Context, arg database.GetWorkspaceProxyByHostnameParams) (database.WorkspaceProxy, error) {
	start := time.Now()
	proxy, err := m.s.GetWorkspaceProxyByHostname(ctx, arg)
	m.queryLatencies.WithLabelValues("GetWorkspaceProxyByHostname").Observe(time.Since(start).Seconds())
	return proxy, err
}

func (m metricsStore) GetWorkspaceProxyByID(ctx context.Context, id uuid.UUID) (database.WorkspaceProxy, error) {
	start := time.Now()
	proxy, err := m.s.GetWorkspaceProxyByID(ctx, id)
	m.queryLatencies.WithLabelValues("GetWorkspaceProxyByID").Observe(time.Since(start).Seconds())
	return proxy, err
}

func (m metricsStore) GetWorkspaceProxyByName(ctx context.Context, name string) (database.WorkspaceProxy, error) {
	start := time.Now()
	proxy, err := m.s.GetWorkspaceProxyByName(ctx, name)
	m.queryLatencies.WithLabelValues("GetWorkspaceProxyByName").Observe(time.Since(start).Seconds())
	return proxy, err
}

func (m metricsStore) GetWorkspaceResourceByID(ctx context.Context, id uuid.UUID) (database.WorkspaceResource, error) {
	start := time.Now()
	resource, err := m.s.GetWorkspaceResourceByID(ctx, id)
	m.queryLatencies.WithLabelValues("GetWorkspaceResourceByID").Observe(time.Since(start).Seconds())
	return resource, err
}

func (m metricsStore) GetWorkspaceResourceMetadataByResourceIDs(ctx context.Context, ids []uuid.UUID) ([]database.WorkspaceResourceMetadatum, error) {
	start := time.Now()
	metadata, err := m.s.GetWorkspaceResourceMetadataByResourceIDs(ctx, ids)
	m.queryLatencies.WithLabelValues("GetWorkspaceResourceMetadataByResourceIDs").Observe(time.Since(start).Seconds())
	return metadata, err
}

func (m metricsStore) GetWorkspaceResourceMetadataCreatedAfter(ctx context.Context, createdAt time.Time) ([]database.WorkspaceResourceMetadatum, error) {
	start := time.Now()
	metadata, err := m.s.GetWorkspaceResourceMetadataCreatedAfter(ctx, createdAt)
	m.queryLatencies.WithLabelValues("GetWorkspaceResourceMetadataCreatedAfter").Observe(time.Since(start).Seconds())
	return metadata, err
}

func (m metricsStore) GetWorkspaceResourcesByJobID(ctx context.Context, jobID uuid.UUID) ([]database.WorkspaceResource, error) {
	start := time.Now()
	resources, err := m.s.GetWorkspaceResourcesByJobID(ctx, jobID)
	m.queryLatencies.WithLabelValues("GetWorkspaceResourcesByJobID").Observe(time.Since(start).Seconds())
	return resources, err
}

func (m metricsStore) GetWorkspaceResourcesByJobIDs(ctx context.Context, ids []uuid.UUID) ([]database.WorkspaceResource, error) {
	start := time.Now()
	resources, err := m.s.GetWorkspaceResourcesByJobIDs(ctx, ids)
	m.queryLatencies.WithLabelValues("GetWorkspaceResourcesByJobIDs").Observe(time.Since(start).Seconds())
	return resources, err
}

func (m metricsStore) GetWorkspaceResourcesCreatedAfter(ctx context.Context, createdAt time.Time) ([]database.WorkspaceResource, error) {
	start := time.Now()
	resources, err := m.s.GetWorkspaceResourcesCreatedAfter(ctx, createdAt)
	m.queryLatencies.WithLabelValues("GetWorkspaceResourcesCreatedAfter").Observe(time.Since(start).Seconds())
	return resources, err
}

func (m metricsStore) GetWorkspaceUniqueOwnerCountByTemplateIDs(ctx context.Context, templateIds []uuid.UUID) ([]database.GetWorkspaceUniqueOwnerCountByTemplateIDsRow, error) {
	start := time.Now()
	r0, r1 := m.s.GetWorkspaceUniqueOwnerCountByTemplateIDs(ctx, templateIds)
	m.queryLatencies.WithLabelValues("GetWorkspaceUniqueOwnerCountByTemplateIDs").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetWorkspaces(ctx context.Context, arg database.GetWorkspacesParams) ([]database.GetWorkspacesRow, error) {
	start := time.Now()
	workspaces, err := m.s.GetWorkspaces(ctx, arg)
	m.queryLatencies.WithLabelValues("GetWorkspaces").Observe(time.Since(start).Seconds())
	return workspaces, err
}

func (m metricsStore) GetWorkspacesEligibleForTransition(ctx context.Context, now time.Time) ([]database.Workspace, error) {
	start := time.Now()
	workspaces, err := m.s.GetWorkspacesEligibleForTransition(ctx, now)
	m.queryLatencies.WithLabelValues("GetWorkspacesEligibleForAutoStartStop").Observe(time.Since(start).Seconds())
	return workspaces, err
}

func (m metricsStore) InsertAPIKey(ctx context.Context, arg database.InsertAPIKeyParams) (database.APIKey, error) {
	start := time.Now()
	key, err := m.s.InsertAPIKey(ctx, arg)
	m.queryLatencies.WithLabelValues("InsertAPIKey").Observe(time.Since(start).Seconds())
	return key, err
}

func (m metricsStore) InsertAllUsersGroup(ctx context.Context, organizationID uuid.UUID) (database.Group, error) {
	start := time.Now()
	group, err := m.s.InsertAllUsersGroup(ctx, organizationID)
	m.queryLatencies.WithLabelValues("InsertAllUsersGroup").Observe(time.Since(start).Seconds())
	return group, err
}

func (m metricsStore) InsertAuditLog(ctx context.Context, arg database.InsertAuditLogParams) (database.AuditLog, error) {
	start := time.Now()
	log, err := m.s.InsertAuditLog(ctx, arg)
	m.queryLatencies.WithLabelValues("InsertAuditLog").Observe(time.Since(start).Seconds())
	return log, err
}

func (m metricsStore) InsertDBCryptKey(ctx context.Context, arg database.InsertDBCryptKeyParams) error {
	start := time.Now()
	r0 := m.s.InsertDBCryptKey(ctx, arg)
	m.queryLatencies.WithLabelValues("InsertDBCryptKey").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) InsertDERPMeshKey(ctx context.Context, value string) error {
	start := time.Now()
	err := m.s.InsertDERPMeshKey(ctx, value)
	m.queryLatencies.WithLabelValues("InsertDERPMeshKey").Observe(time.Since(start).Seconds())
	return err
}

func (m metricsStore) InsertDeploymentID(ctx context.Context, value string) error {
	start := time.Now()
	err := m.s.InsertDeploymentID(ctx, value)
	m.queryLatencies.WithLabelValues("InsertDeploymentID").Observe(time.Since(start).Seconds())
	return err
}

func (m metricsStore) InsertExternalAuthLink(ctx context.Context, arg database.InsertExternalAuthLinkParams) (database.ExternalAuthLink, error) {
	start := time.Now()
	link, err := m.s.InsertExternalAuthLink(ctx, arg)
	m.queryLatencies.WithLabelValues("InsertExternalAuthLink").Observe(time.Since(start).Seconds())
	return link, err
}

func (m metricsStore) InsertFile(ctx context.Context, arg database.InsertFileParams) (database.File, error) {
	start := time.Now()
	file, err := m.s.InsertFile(ctx, arg)
	m.queryLatencies.WithLabelValues("InsertFile").Observe(time.Since(start).Seconds())
	return file, err
}

func (m metricsStore) InsertGitSSHKey(ctx context.Context, arg database.InsertGitSSHKeyParams) (database.GitSSHKey, error) {
	start := time.Now()
	key, err := m.s.InsertGitSSHKey(ctx, arg)
	m.queryLatencies.WithLabelValues("InsertGitSSHKey").Observe(time.Since(start).Seconds())
	return key, err
}

func (m metricsStore) InsertGroup(ctx context.Context, arg database.InsertGroupParams) (database.Group, error) {
	start := time.Now()
	group, err := m.s.InsertGroup(ctx, arg)
	m.queryLatencies.WithLabelValues("InsertGroup").Observe(time.Since(start).Seconds())
	return group, err
}

func (m metricsStore) InsertGroupMember(ctx context.Context, arg database.InsertGroupMemberParams) error {
	start := time.Now()
	err := m.s.InsertGroupMember(ctx, arg)
	m.queryLatencies.WithLabelValues("InsertGroupMember").Observe(time.Since(start).Seconds())
	return err
}

func (m metricsStore) InsertLicense(ctx context.Context, arg database.InsertLicenseParams) (database.License, error) {
	start := time.Now()
	license, err := m.s.InsertLicense(ctx, arg)
	m.queryLatencies.WithLabelValues("InsertLicense").Observe(time.Since(start).Seconds())
	return license, err
}

func (m metricsStore) InsertMissingGroups(ctx context.Context, arg database.InsertMissingGroupsParams) ([]database.Group, error) {
	start := time.Now()
	r0, r1 := m.s.InsertMissingGroups(ctx, arg)
	m.queryLatencies.WithLabelValues("InsertMissingGroups").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) InsertOAuth2ProviderApp(ctx context.Context, arg database.InsertOAuth2ProviderAppParams) (database.OAuth2ProviderApp, error) {
	start := time.Now()
	r0, r1 := m.s.InsertOAuth2ProviderApp(ctx, arg)
	m.queryLatencies.WithLabelValues("InsertOAuth2ProviderApp").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) InsertOAuth2ProviderAppCode(ctx context.Context, arg database.InsertOAuth2ProviderAppCodeParams) (database.OAuth2ProviderAppCode, error) {
	start := time.Now()
	r0, r1 := m.s.InsertOAuth2ProviderAppCode(ctx, arg)
	m.queryLatencies.WithLabelValues("InsertOAuth2ProviderAppCode").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) InsertOAuth2ProviderAppSecret(ctx context.Context, arg database.InsertOAuth2ProviderAppSecretParams) (database.OAuth2ProviderAppSecret, error) {
	start := time.Now()
	r0, r1 := m.s.InsertOAuth2ProviderAppSecret(ctx, arg)
	m.queryLatencies.WithLabelValues("InsertOAuth2ProviderAppSecret").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) InsertOAuth2ProviderAppToken(ctx context.Context, arg database.InsertOAuth2ProviderAppTokenParams) (database.OAuth2ProviderAppToken, error) {
	start := time.Now()
	r0, r1 := m.s.InsertOAuth2ProviderAppToken(ctx, arg)
	m.queryLatencies.WithLabelValues("InsertOAuth2ProviderAppToken").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) InsertOrganization(ctx context.Context, arg database.InsertOrganizationParams) (database.Organization, error) {
	start := time.Now()
	organization, err := m.s.InsertOrganization(ctx, arg)
	m.queryLatencies.WithLabelValues("InsertOrganization").Observe(time.Since(start).Seconds())
	return organization, err
}

func (m metricsStore) InsertOrganizationMember(ctx context.Context, arg database.InsertOrganizationMemberParams) (database.OrganizationMember, error) {
	start := time.Now()
	member, err := m.s.InsertOrganizationMember(ctx, arg)
	m.queryLatencies.WithLabelValues("InsertOrganizationMember").Observe(time.Since(start).Seconds())
	return member, err
}

func (m metricsStore) InsertProvisionerJob(ctx context.Context, arg database.InsertProvisionerJobParams) (database.ProvisionerJob, error) {
	start := time.Now()
	job, err := m.s.InsertProvisionerJob(ctx, arg)
	m.queryLatencies.WithLabelValues("InsertProvisionerJob").Observe(time.Since(start).Seconds())
	return job, err
}

func (m metricsStore) InsertProvisionerJobLogs(ctx context.Context, arg database.InsertProvisionerJobLogsParams) ([]database.ProvisionerJobLog, error) {
	start := time.Now()
	logs, err := m.s.InsertProvisionerJobLogs(ctx, arg)
	m.queryLatencies.WithLabelValues("InsertProvisionerJobLogs").Observe(time.Since(start).Seconds())
	return logs, err
}

func (m metricsStore) InsertReplica(ctx context.Context, arg database.InsertReplicaParams) (database.Replica, error) {
	start := time.Now()
	replica, err := m.s.InsertReplica(ctx, arg)
	m.queryLatencies.WithLabelValues("InsertReplica").Observe(time.Since(start).Seconds())
	return replica, err
}

func (m metricsStore) InsertTemplate(ctx context.Context, arg database.InsertTemplateParams) error {
	start := time.Now()
	err := m.s.InsertTemplate(ctx, arg)
	m.queryLatencies.WithLabelValues("InsertTemplate").Observe(time.Since(start).Seconds())
	return err
}

func (m metricsStore) InsertTemplateVersion(ctx context.Context, arg database.InsertTemplateVersionParams) error {
	start := time.Now()
	err := m.s.InsertTemplateVersion(ctx, arg)
	m.queryLatencies.WithLabelValues("InsertTemplateVersion").Observe(time.Since(start).Seconds())
	return err
}

func (m metricsStore) InsertTemplateVersionParameter(ctx context.Context, arg database.InsertTemplateVersionParameterParams) (database.TemplateVersionParameter, error) {
	start := time.Now()
	parameter, err := m.s.InsertTemplateVersionParameter(ctx, arg)
	m.queryLatencies.WithLabelValues("InsertTemplateVersionParameter").Observe(time.Since(start).Seconds())
	return parameter, err
}

func (m metricsStore) InsertTemplateVersionVariable(ctx context.Context, arg database.InsertTemplateVersionVariableParams) (database.TemplateVersionVariable, error) {
	start := time.Now()
	variable, err := m.s.InsertTemplateVersionVariable(ctx, arg)
	m.queryLatencies.WithLabelValues("InsertTemplateVersionVariable").Observe(time.Since(start).Seconds())
	return variable, err
}

func (m metricsStore) InsertUser(ctx context.Context, arg database.InsertUserParams) (database.User, error) {
	start := time.Now()
	user, err := m.s.InsertUser(ctx, arg)
	m.queryLatencies.WithLabelValues("InsertUser").Observe(time.Since(start).Seconds())
	return user, err
}

func (m metricsStore) InsertUserGroupsByName(ctx context.Context, arg database.InsertUserGroupsByNameParams) error {
	start := time.Now()
	err := m.s.InsertUserGroupsByName(ctx, arg)
	m.queryLatencies.WithLabelValues("InsertUserGroupsByName").Observe(time.Since(start).Seconds())
	return err
}

func (m metricsStore) InsertUserLink(ctx context.Context, arg database.InsertUserLinkParams) (database.UserLink, error) {
	start := time.Now()
	link, err := m.s.InsertUserLink(ctx, arg)
	m.queryLatencies.WithLabelValues("InsertUserLink").Observe(time.Since(start).Seconds())
	return link, err
}

func (m metricsStore) InsertWorkspace(ctx context.Context, arg database.InsertWorkspaceParams) (database.Workspace, error) {
	start := time.Now()
	workspace, err := m.s.InsertWorkspace(ctx, arg)
	m.queryLatencies.WithLabelValues("InsertWorkspace").Observe(time.Since(start).Seconds())
	return workspace, err
}

func (m metricsStore) InsertWorkspaceAgent(ctx context.Context, arg database.InsertWorkspaceAgentParams) (database.WorkspaceAgent, error) {
	start := time.Now()
	agent, err := m.s.InsertWorkspaceAgent(ctx, arg)
	m.queryLatencies.WithLabelValues("InsertWorkspaceAgent").Observe(time.Since(start).Seconds())
	return agent, err
}

func (m metricsStore) InsertWorkspaceAgentLogSources(ctx context.Context, arg database.InsertWorkspaceAgentLogSourcesParams) ([]database.WorkspaceAgentLogSource, error) {
	start := time.Now()
	r0, r1 := m.s.InsertWorkspaceAgentLogSources(ctx, arg)
	m.queryLatencies.WithLabelValues("InsertWorkspaceAgentLogSources").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) InsertWorkspaceAgentLogs(ctx context.Context, arg database.InsertWorkspaceAgentLogsParams) ([]database.WorkspaceAgentLog, error) {
	start := time.Now()
	r0, r1 := m.s.InsertWorkspaceAgentLogs(ctx, arg)
	m.queryLatencies.WithLabelValues("InsertWorkspaceAgentLogs").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) InsertWorkspaceAgentMetadata(ctx context.Context, arg database.InsertWorkspaceAgentMetadataParams) error {
	start := time.Now()
	err := m.s.InsertWorkspaceAgentMetadata(ctx, arg)
	m.queryLatencies.WithLabelValues("InsertWorkspaceAgentMetadata").Observe(time.Since(start).Seconds())
	return err
}

func (m metricsStore) InsertWorkspaceAgentScripts(ctx context.Context, arg database.InsertWorkspaceAgentScriptsParams) ([]database.WorkspaceAgentScript, error) {
	start := time.Now()
	r0, r1 := m.s.InsertWorkspaceAgentScripts(ctx, arg)
	m.queryLatencies.WithLabelValues("InsertWorkspaceAgentScripts").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) InsertWorkspaceAgentStats(ctx context.Context, arg database.InsertWorkspaceAgentStatsParams) error {
	start := time.Now()
	r0 := m.s.InsertWorkspaceAgentStats(ctx, arg)
	m.queryLatencies.WithLabelValues("InsertWorkspaceAgentStats").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) InsertWorkspaceApp(ctx context.Context, arg database.InsertWorkspaceAppParams) (database.WorkspaceApp, error) {
	start := time.Now()
	app, err := m.s.InsertWorkspaceApp(ctx, arg)
	m.queryLatencies.WithLabelValues("InsertWorkspaceApp").Observe(time.Since(start).Seconds())
	return app, err
}

func (m metricsStore) InsertWorkspaceAppStats(ctx context.Context, arg database.InsertWorkspaceAppStatsParams) error {
	start := time.Now()
	r0 := m.s.InsertWorkspaceAppStats(ctx, arg)
	m.queryLatencies.WithLabelValues("InsertWorkspaceAppStats").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) InsertWorkspaceBuild(ctx context.Context, arg database.InsertWorkspaceBuildParams) error {
	start := time.Now()
	err := m.s.InsertWorkspaceBuild(ctx, arg)
	m.queryLatencies.WithLabelValues("InsertWorkspaceBuild").Observe(time.Since(start).Seconds())
	return err
}

func (m metricsStore) InsertWorkspaceBuildParameters(ctx context.Context, arg database.InsertWorkspaceBuildParametersParams) error {
	start := time.Now()
	err := m.s.InsertWorkspaceBuildParameters(ctx, arg)
	m.queryLatencies.WithLabelValues("InsertWorkspaceBuildParameters").Observe(time.Since(start).Seconds())
	return err
}

func (m metricsStore) InsertWorkspaceProxy(ctx context.Context, arg database.InsertWorkspaceProxyParams) (database.WorkspaceProxy, error) {
	start := time.Now()
	proxy, err := m.s.InsertWorkspaceProxy(ctx, arg)
	m.queryLatencies.WithLabelValues("InsertWorkspaceProxy").Observe(time.Since(start).Seconds())
	return proxy, err
}

func (m metricsStore) InsertWorkspaceResource(ctx context.Context, arg database.InsertWorkspaceResourceParams) (database.WorkspaceResource, error) {
	start := time.Now()
	resource, err := m.s.InsertWorkspaceResource(ctx, arg)
	m.queryLatencies.WithLabelValues("InsertWorkspaceResource").Observe(time.Since(start).Seconds())
	return resource, err
}

func (m metricsStore) InsertWorkspaceResourceMetadata(ctx context.Context, arg database.InsertWorkspaceResourceMetadataParams) ([]database.WorkspaceResourceMetadatum, error) {
	start := time.Now()
	metadata, err := m.s.InsertWorkspaceResourceMetadata(ctx, arg)
	m.queryLatencies.WithLabelValues("InsertWorkspaceResourceMetadata").Observe(time.Since(start).Seconds())
	return metadata, err
}

func (m metricsStore) ListWorkspaceAgentPortShares(ctx context.Context, workspaceID uuid.UUID) ([]database.WorkspaceAgentPortShare, error) {
	start := time.Now()
	r0, r1 := m.s.ListWorkspaceAgentPortShares(ctx, workspaceID)
	m.queryLatencies.WithLabelValues("ListWorkspaceAgentPortShares").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) ReduceWorkspaceAgentShareLevelToAuthenticatedByTemplate(ctx context.Context, templateID uuid.UUID) error {
	start := time.Now()
	r0 := m.s.ReduceWorkspaceAgentShareLevelToAuthenticatedByTemplate(ctx, templateID)
	m.queryLatencies.WithLabelValues("ReduceWorkspaceAgentShareLevelToAuthenticatedByTemplate").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) RegisterWorkspaceProxy(ctx context.Context, arg database.RegisterWorkspaceProxyParams) (database.WorkspaceProxy, error) {
	start := time.Now()
	proxy, err := m.s.RegisterWorkspaceProxy(ctx, arg)
	m.queryLatencies.WithLabelValues("RegisterWorkspaceProxy").Observe(time.Since(start).Seconds())
	return proxy, err
}

func (m metricsStore) RemoveUserFromAllGroups(ctx context.Context, userID uuid.UUID) error {
	start := time.Now()
	r0 := m.s.RemoveUserFromAllGroups(ctx, userID)
	m.queryLatencies.WithLabelValues("RemoveUserFromAllGroups").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) RevokeDBCryptKey(ctx context.Context, activeKeyDigest string) error {
	start := time.Now()
	r0 := m.s.RevokeDBCryptKey(ctx, activeKeyDigest)
	m.queryLatencies.WithLabelValues("RevokeDBCryptKey").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) TryAcquireLock(ctx context.Context, pgTryAdvisoryXactLock int64) (bool, error) {
	start := time.Now()
	ok, err := m.s.TryAcquireLock(ctx, pgTryAdvisoryXactLock)
	m.queryLatencies.WithLabelValues("TryAcquireLock").Observe(time.Since(start).Seconds())
	return ok, err
}

func (m metricsStore) UnarchiveTemplateVersion(ctx context.Context, arg database.UnarchiveTemplateVersionParams) error {
	start := time.Now()
	r0 := m.s.UnarchiveTemplateVersion(ctx, arg)
	m.queryLatencies.WithLabelValues("UnarchiveTemplateVersion").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) UnfavoriteWorkspace(ctx context.Context, arg uuid.UUID) error {
	start := time.Now()
	r0 := m.s.UnfavoriteWorkspace(ctx, arg)
	m.queryLatencies.WithLabelValues("UnfavoriteWorkspace").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) UpdateAPIKeyByID(ctx context.Context, arg database.UpdateAPIKeyByIDParams) error {
	start := time.Now()
	err := m.s.UpdateAPIKeyByID(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateAPIKeyByID").Observe(time.Since(start).Seconds())
	return err
}

func (m metricsStore) UpdateExternalAuthLink(ctx context.Context, arg database.UpdateExternalAuthLinkParams) (database.ExternalAuthLink, error) {
	start := time.Now()
	link, err := m.s.UpdateExternalAuthLink(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateExternalAuthLink").Observe(time.Since(start).Seconds())
	return link, err
}

func (m metricsStore) UpdateGitSSHKey(ctx context.Context, arg database.UpdateGitSSHKeyParams) (database.GitSSHKey, error) {
	start := time.Now()
	key, err := m.s.UpdateGitSSHKey(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateGitSSHKey").Observe(time.Since(start).Seconds())
	return key, err
}

func (m metricsStore) UpdateGroupByID(ctx context.Context, arg database.UpdateGroupByIDParams) (database.Group, error) {
	start := time.Now()
	group, err := m.s.UpdateGroupByID(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateGroupByID").Observe(time.Since(start).Seconds())
	return group, err
}

func (m metricsStore) UpdateInactiveUsersToDormant(ctx context.Context, lastSeenAfter database.UpdateInactiveUsersToDormantParams) ([]database.UpdateInactiveUsersToDormantRow, error) {
	start := time.Now()
	r0, r1 := m.s.UpdateInactiveUsersToDormant(ctx, lastSeenAfter)
	m.queryLatencies.WithLabelValues("UpdateInactiveUsersToDormant").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) UpdateMemberRoles(ctx context.Context, arg database.UpdateMemberRolesParams) (database.OrganizationMember, error) {
	start := time.Now()
	member, err := m.s.UpdateMemberRoles(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateMemberRoles").Observe(time.Since(start).Seconds())
	return member, err
}

func (m metricsStore) UpdateOAuth2ProviderAppByID(ctx context.Context, arg database.UpdateOAuth2ProviderAppByIDParams) (database.OAuth2ProviderApp, error) {
	start := time.Now()
	r0, r1 := m.s.UpdateOAuth2ProviderAppByID(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateOAuth2ProviderAppByID").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) UpdateOAuth2ProviderAppSecretByID(ctx context.Context, arg database.UpdateOAuth2ProviderAppSecretByIDParams) (database.OAuth2ProviderAppSecret, error) {
	start := time.Now()
	r0, r1 := m.s.UpdateOAuth2ProviderAppSecretByID(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateOAuth2ProviderAppSecretByID").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) UpdateProvisionerDaemonLastSeenAt(ctx context.Context, arg database.UpdateProvisionerDaemonLastSeenAtParams) error {
	start := time.Now()
	r0 := m.s.UpdateProvisionerDaemonLastSeenAt(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateProvisionerDaemonLastSeenAt").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) UpdateProvisionerJobByID(ctx context.Context, arg database.UpdateProvisionerJobByIDParams) error {
	start := time.Now()
	err := m.s.UpdateProvisionerJobByID(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateProvisionerJobByID").Observe(time.Since(start).Seconds())
	return err
}

func (m metricsStore) UpdateProvisionerJobWithCancelByID(ctx context.Context, arg database.UpdateProvisionerJobWithCancelByIDParams) error {
	start := time.Now()
	err := m.s.UpdateProvisionerJobWithCancelByID(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateProvisionerJobWithCancelByID").Observe(time.Since(start).Seconds())
	return err
}

func (m metricsStore) UpdateProvisionerJobWithCompleteByID(ctx context.Context, arg database.UpdateProvisionerJobWithCompleteByIDParams) error {
	start := time.Now()
	err := m.s.UpdateProvisionerJobWithCompleteByID(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateProvisionerJobWithCompleteByID").Observe(time.Since(start).Seconds())
	return err
}

func (m metricsStore) UpdateReplica(ctx context.Context, arg database.UpdateReplicaParams) (database.Replica, error) {
	start := time.Now()
	replica, err := m.s.UpdateReplica(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateReplica").Observe(time.Since(start).Seconds())
	return replica, err
}

func (m metricsStore) UpdateTemplateACLByID(ctx context.Context, arg database.UpdateTemplateACLByIDParams) error {
	start := time.Now()
	err := m.s.UpdateTemplateACLByID(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateTemplateACLByID").Observe(time.Since(start).Seconds())
	return err
}

func (m metricsStore) UpdateTemplateAccessControlByID(ctx context.Context, arg database.UpdateTemplateAccessControlByIDParams) error {
	start := time.Now()
	r0 := m.s.UpdateTemplateAccessControlByID(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateTemplateAccessControlByID").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) UpdateTemplateActiveVersionByID(ctx context.Context, arg database.UpdateTemplateActiveVersionByIDParams) error {
	start := time.Now()
	err := m.s.UpdateTemplateActiveVersionByID(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateTemplateActiveVersionByID").Observe(time.Since(start).Seconds())
	return err
}

func (m metricsStore) UpdateTemplateDeletedByID(ctx context.Context, arg database.UpdateTemplateDeletedByIDParams) error {
	start := time.Now()
	err := m.s.UpdateTemplateDeletedByID(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateTemplateDeletedByID").Observe(time.Since(start).Seconds())
	return err
}

func (m metricsStore) UpdateTemplateMetaByID(ctx context.Context, arg database.UpdateTemplateMetaByIDParams) error {
	start := time.Now()
	err := m.s.UpdateTemplateMetaByID(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateTemplateMetaByID").Observe(time.Since(start).Seconds())
	return err
}

func (m metricsStore) UpdateTemplateScheduleByID(ctx context.Context, arg database.UpdateTemplateScheduleByIDParams) error {
	start := time.Now()
	err := m.s.UpdateTemplateScheduleByID(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateTemplateScheduleByID").Observe(time.Since(start).Seconds())
	return err
}

func (m metricsStore) UpdateTemplateVersionByID(ctx context.Context, arg database.UpdateTemplateVersionByIDParams) error {
	start := time.Now()
	err := m.s.UpdateTemplateVersionByID(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateTemplateVersionByID").Observe(time.Since(start).Seconds())
	return err
}

func (m metricsStore) UpdateTemplateVersionDescriptionByJobID(ctx context.Context, arg database.UpdateTemplateVersionDescriptionByJobIDParams) error {
	start := time.Now()
	err := m.s.UpdateTemplateVersionDescriptionByJobID(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateTemplateVersionDescriptionByJobID").Observe(time.Since(start).Seconds())
	return err
}

func (m metricsStore) UpdateTemplateVersionExternalAuthProvidersByJobID(ctx context.Context, arg database.UpdateTemplateVersionExternalAuthProvidersByJobIDParams) error {
	start := time.Now()
	err := m.s.UpdateTemplateVersionExternalAuthProvidersByJobID(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateTemplateVersionExternalAuthProvidersByJobID").Observe(time.Since(start).Seconds())
	return err
}

func (m metricsStore) UpdateTemplateWorkspacesLastUsedAt(ctx context.Context, arg database.UpdateTemplateWorkspacesLastUsedAtParams) error {
	start := time.Now()
	r0 := m.s.UpdateTemplateWorkspacesLastUsedAt(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateTemplateWorkspacesLastUsedAt").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) UpdateUserAppearanceSettings(ctx context.Context, arg database.UpdateUserAppearanceSettingsParams) (database.User, error) {
	start := time.Now()
	r0, r1 := m.s.UpdateUserAppearanceSettings(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateUserAppearanceSettings").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) UpdateUserDeletedByID(ctx context.Context, id uuid.UUID) error {
	start := time.Now()
	r0 := m.s.UpdateUserDeletedByID(ctx, id)
	m.queryLatencies.WithLabelValues("UpdateUserDeletedByID").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) UpdateUserHashedPassword(ctx context.Context, arg database.UpdateUserHashedPasswordParams) error {
	start := time.Now()
	err := m.s.UpdateUserHashedPassword(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateUserHashedPassword").Observe(time.Since(start).Seconds())
	return err
}

func (m metricsStore) UpdateUserLastSeenAt(ctx context.Context, arg database.UpdateUserLastSeenAtParams) (database.User, error) {
	start := time.Now()
	user, err := m.s.UpdateUserLastSeenAt(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateUserLastSeenAt").Observe(time.Since(start).Seconds())
	return user, err
}

func (m metricsStore) UpdateUserLink(ctx context.Context, arg database.UpdateUserLinkParams) (database.UserLink, error) {
	start := time.Now()
	link, err := m.s.UpdateUserLink(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateUserLink").Observe(time.Since(start).Seconds())
	return link, err
}

func (m metricsStore) UpdateUserLinkedID(ctx context.Context, arg database.UpdateUserLinkedIDParams) (database.UserLink, error) {
	start := time.Now()
	link, err := m.s.UpdateUserLinkedID(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateUserLinkedID").Observe(time.Since(start).Seconds())
	return link, err
}

func (m metricsStore) UpdateUserLoginType(ctx context.Context, arg database.UpdateUserLoginTypeParams) (database.User, error) {
	start := time.Now()
	r0, r1 := m.s.UpdateUserLoginType(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateUserLoginType").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) UpdateUserProfile(ctx context.Context, arg database.UpdateUserProfileParams) (database.User, error) {
	start := time.Now()
	user, err := m.s.UpdateUserProfile(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateUserProfile").Observe(time.Since(start).Seconds())
	return user, err
}

func (m metricsStore) UpdateUserQuietHoursSchedule(ctx context.Context, arg database.UpdateUserQuietHoursScheduleParams) (database.User, error) {
	start := time.Now()
	r0, r1 := m.s.UpdateUserQuietHoursSchedule(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateUserQuietHoursSchedule").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) UpdateUserRoles(ctx context.Context, arg database.UpdateUserRolesParams) (database.User, error) {
	start := time.Now()
	user, err := m.s.UpdateUserRoles(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateUserRoles").Observe(time.Since(start).Seconds())
	return user, err
}

func (m metricsStore) UpdateUserStatus(ctx context.Context, arg database.UpdateUserStatusParams) (database.User, error) {
	start := time.Now()
	user, err := m.s.UpdateUserStatus(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateUserStatus").Observe(time.Since(start).Seconds())
	return user, err
}

func (m metricsStore) UpdateWorkspace(ctx context.Context, arg database.UpdateWorkspaceParams) (database.Workspace, error) {
	start := time.Now()
	workspace, err := m.s.UpdateWorkspace(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateWorkspace").Observe(time.Since(start).Seconds())
	return workspace, err
}

func (m metricsStore) UpdateWorkspaceAgentConnectionByID(ctx context.Context, arg database.UpdateWorkspaceAgentConnectionByIDParams) error {
	start := time.Now()
	err := m.s.UpdateWorkspaceAgentConnectionByID(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateWorkspaceAgentConnectionByID").Observe(time.Since(start).Seconds())
	return err
}

func (m metricsStore) UpdateWorkspaceAgentLifecycleStateByID(ctx context.Context, arg database.UpdateWorkspaceAgentLifecycleStateByIDParams) error {
	start := time.Now()
	r0 := m.s.UpdateWorkspaceAgentLifecycleStateByID(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateWorkspaceAgentLifecycleStateByID").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) UpdateWorkspaceAgentLogOverflowByID(ctx context.Context, arg database.UpdateWorkspaceAgentLogOverflowByIDParams) error {
	start := time.Now()
	r0 := m.s.UpdateWorkspaceAgentLogOverflowByID(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateWorkspaceAgentLogOverflowByID").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) UpdateWorkspaceAgentMetadata(ctx context.Context, arg database.UpdateWorkspaceAgentMetadataParams) error {
	start := time.Now()
	err := m.s.UpdateWorkspaceAgentMetadata(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateWorkspaceAgentMetadata").Observe(time.Since(start).Seconds())
	return err
}

func (m metricsStore) UpdateWorkspaceAgentStartupByID(ctx context.Context, arg database.UpdateWorkspaceAgentStartupByIDParams) error {
	start := time.Now()
	err := m.s.UpdateWorkspaceAgentStartupByID(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateWorkspaceAgentStartupByID").Observe(time.Since(start).Seconds())
	return err
}

func (m metricsStore) UpdateWorkspaceAppHealthByID(ctx context.Context, arg database.UpdateWorkspaceAppHealthByIDParams) error {
	start := time.Now()
	err := m.s.UpdateWorkspaceAppHealthByID(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateWorkspaceAppHealthByID").Observe(time.Since(start).Seconds())
	return err
}

func (m metricsStore) UpdateWorkspaceAutomaticUpdates(ctx context.Context, arg database.UpdateWorkspaceAutomaticUpdatesParams) error {
	start := time.Now()
	r0 := m.s.UpdateWorkspaceAutomaticUpdates(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateWorkspaceAutomaticUpdates").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) UpdateWorkspaceAutostart(ctx context.Context, arg database.UpdateWorkspaceAutostartParams) error {
	start := time.Now()
	err := m.s.UpdateWorkspaceAutostart(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateWorkspaceAutostart").Observe(time.Since(start).Seconds())
	return err
}

func (m metricsStore) UpdateWorkspaceBuildCostByID(ctx context.Context, arg database.UpdateWorkspaceBuildCostByIDParams) error {
	start := time.Now()
	err := m.s.UpdateWorkspaceBuildCostByID(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateWorkspaceBuildCostByID").Observe(time.Since(start).Seconds())
	return err
}

func (m metricsStore) UpdateWorkspaceBuildDeadlineByID(ctx context.Context, arg database.UpdateWorkspaceBuildDeadlineByIDParams) error {
	start := time.Now()
	r0 := m.s.UpdateWorkspaceBuildDeadlineByID(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateWorkspaceBuildDeadlineByID").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) UpdateWorkspaceBuildProvisionerStateByID(ctx context.Context, arg database.UpdateWorkspaceBuildProvisionerStateByIDParams) error {
	start := time.Now()
	r0 := m.s.UpdateWorkspaceBuildProvisionerStateByID(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateWorkspaceBuildProvisionerStateByID").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) UpdateWorkspaceDeletedByID(ctx context.Context, arg database.UpdateWorkspaceDeletedByIDParams) error {
	start := time.Now()
	err := m.s.UpdateWorkspaceDeletedByID(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateWorkspaceDeletedByID").Observe(time.Since(start).Seconds())
	return err
}

func (m metricsStore) UpdateWorkspaceDormantDeletingAt(ctx context.Context, arg database.UpdateWorkspaceDormantDeletingAtParams) (database.Workspace, error) {
	start := time.Now()
	ws, r0 := m.s.UpdateWorkspaceDormantDeletingAt(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateWorkspaceDormantDeletingAt").Observe(time.Since(start).Seconds())
	return ws, r0
}

func (m metricsStore) UpdateWorkspaceLastUsedAt(ctx context.Context, arg database.UpdateWorkspaceLastUsedAtParams) error {
	start := time.Now()
	err := m.s.UpdateWorkspaceLastUsedAt(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateWorkspaceLastUsedAt").Observe(time.Since(start).Seconds())
	return err
}

func (m metricsStore) UpdateWorkspaceProxy(ctx context.Context, arg database.UpdateWorkspaceProxyParams) (database.WorkspaceProxy, error) {
	start := time.Now()
	proxy, err := m.s.UpdateWorkspaceProxy(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateWorkspaceProxy").Observe(time.Since(start).Seconds())
	return proxy, err
}

func (m metricsStore) UpdateWorkspaceProxyDeleted(ctx context.Context, arg database.UpdateWorkspaceProxyDeletedParams) error {
	start := time.Now()
	r0 := m.s.UpdateWorkspaceProxyDeleted(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateWorkspaceProxyDeleted").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) UpdateWorkspaceTTL(ctx context.Context, arg database.UpdateWorkspaceTTLParams) error {
	start := time.Now()
	r0 := m.s.UpdateWorkspaceTTL(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateWorkspaceTTL").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) UpdateWorkspacesDormantDeletingAtByTemplateID(ctx context.Context, arg database.UpdateWorkspacesDormantDeletingAtByTemplateIDParams) error {
	start := time.Now()
	r0 := m.s.UpdateWorkspacesDormantDeletingAtByTemplateID(ctx, arg)
	m.queryLatencies.WithLabelValues("UpdateWorkspacesDormantDeletingAtByTemplateID").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) UpsertAppSecurityKey(ctx context.Context, value string) error {
	start := time.Now()
	r0 := m.s.UpsertAppSecurityKey(ctx, value)
	m.queryLatencies.WithLabelValues("UpsertAppSecurityKey").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) UpsertApplicationName(ctx context.Context, value string) error {
	start := time.Now()
	r0 := m.s.UpsertApplicationName(ctx, value)
	m.queryLatencies.WithLabelValues("UpsertApplicationName").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) UpsertDefaultProxy(ctx context.Context, arg database.UpsertDefaultProxyParams) error {
	start := time.Now()
	r0 := m.s.UpsertDefaultProxy(ctx, arg)
	m.queryLatencies.WithLabelValues("UpsertDefaultProxy").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) UpsertHealthSettings(ctx context.Context, value string) error {
	start := time.Now()
	r0 := m.s.UpsertHealthSettings(ctx, value)
	m.queryLatencies.WithLabelValues("UpsertHealthSettings").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) UpsertJFrogXrayScanByWorkspaceAndAgentID(ctx context.Context, arg database.UpsertJFrogXrayScanByWorkspaceAndAgentIDParams) error {
	start := time.Now()
	r0 := m.s.UpsertJFrogXrayScanByWorkspaceAndAgentID(ctx, arg)
	m.queryLatencies.WithLabelValues("UpsertJFrogXrayScanByWorkspaceAndAgentID").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) UpsertLastUpdateCheck(ctx context.Context, value string) error {
	start := time.Now()
	r0 := m.s.UpsertLastUpdateCheck(ctx, value)
	m.queryLatencies.WithLabelValues("UpsertLastUpdateCheck").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) UpsertLogoURL(ctx context.Context, value string) error {
	start := time.Now()
	r0 := m.s.UpsertLogoURL(ctx, value)
	m.queryLatencies.WithLabelValues("UpsertLogoURL").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) UpsertOAuthSigningKey(ctx context.Context, value string) error {
	start := time.Now()
	r0 := m.s.UpsertOAuthSigningKey(ctx, value)
	m.queryLatencies.WithLabelValues("UpsertOAuthSigningKey").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) UpsertProvisionerDaemon(ctx context.Context, arg database.UpsertProvisionerDaemonParams) (database.ProvisionerDaemon, error) {
	start := time.Now()
	r0, r1 := m.s.UpsertProvisionerDaemon(ctx, arg)
	m.queryLatencies.WithLabelValues("UpsertProvisionerDaemon").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) UpsertServiceBanner(ctx context.Context, value string) error {
	start := time.Now()
	r0 := m.s.UpsertServiceBanner(ctx, value)
	m.queryLatencies.WithLabelValues("UpsertServiceBanner").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) UpsertTailnetAgent(ctx context.Context, arg database.UpsertTailnetAgentParams) (database.TailnetAgent, error) {
	start := time.Now()
	r0, r1 := m.s.UpsertTailnetAgent(ctx, arg)
	m.queryLatencies.WithLabelValues("UpsertTailnetAgent").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) UpsertTailnetClient(ctx context.Context, arg database.UpsertTailnetClientParams) (database.TailnetClient, error) {
	start := time.Now()
	r0, r1 := m.s.UpsertTailnetClient(ctx, arg)
	m.queryLatencies.WithLabelValues("UpsertTailnetClient").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) UpsertTailnetClientSubscription(ctx context.Context, arg database.UpsertTailnetClientSubscriptionParams) error {
	start := time.Now()
	r0 := m.s.UpsertTailnetClientSubscription(ctx, arg)
	m.queryLatencies.WithLabelValues("UpsertTailnetClientSubscription").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) UpsertTailnetCoordinator(ctx context.Context, id uuid.UUID) (database.TailnetCoordinator, error) {
	start := time.Now()
	r0, r1 := m.s.UpsertTailnetCoordinator(ctx, id)
	m.queryLatencies.WithLabelValues("UpsertTailnetCoordinator").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) UpsertTailnetPeer(ctx context.Context, arg database.UpsertTailnetPeerParams) (database.TailnetPeer, error) {
	start := time.Now()
	r0, r1 := m.s.UpsertTailnetPeer(ctx, arg)
	m.queryLatencies.WithLabelValues("UpsertTailnetPeer").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) UpsertTailnetTunnel(ctx context.Context, arg database.UpsertTailnetTunnelParams) (database.TailnetTunnel, error) {
	start := time.Now()
	r0, r1 := m.s.UpsertTailnetTunnel(ctx, arg)
	m.queryLatencies.WithLabelValues("UpsertTailnetTunnel").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) UpsertTemplateUsageStats(ctx context.Context) error {
	start := time.Now()
	r0 := m.s.UpsertTemplateUsageStats(ctx)
	m.queryLatencies.WithLabelValues("UpsertTemplateUsageStats").Observe(time.Since(start).Seconds())
	return r0
}

func (m metricsStore) UpsertWorkspaceAgentPortShare(ctx context.Context, arg database.UpsertWorkspaceAgentPortShareParams) (database.WorkspaceAgentPortShare, error) {
	start := time.Now()
	r0, r1 := m.s.UpsertWorkspaceAgentPortShare(ctx, arg)
	m.queryLatencies.WithLabelValues("UpsertWorkspaceAgentPortShare").Observe(time.Since(start).Seconds())
	return r0, r1
}

func (m metricsStore) GetAuthorizedTemplates(ctx context.Context, arg database.GetTemplatesWithFilterParams, prepared rbac.PreparedAuthorized) ([]database.Template, error) {
	start := time.Now()
	templates, err := m.s.GetAuthorizedTemplates(ctx, arg, prepared)
	m.queryLatencies.WithLabelValues("GetAuthorizedTemplates").Observe(time.Since(start).Seconds())
	return templates, err
}

func (m metricsStore) GetTemplateGroupRoles(ctx context.Context, id uuid.UUID) ([]database.TemplateGroup, error) {
	start := time.Now()
	roles, err := m.s.GetTemplateGroupRoles(ctx, id)
	m.queryLatencies.WithLabelValues("GetTemplateGroupRoles").Observe(time.Since(start).Seconds())
	return roles, err
}

func (m metricsStore) GetTemplateUserRoles(ctx context.Context, id uuid.UUID) ([]database.TemplateUser, error) {
	start := time.Now()
	roles, err := m.s.GetTemplateUserRoles(ctx, id)
	m.queryLatencies.WithLabelValues("GetTemplateUserRoles").Observe(time.Since(start).Seconds())
	return roles, err
}

func (m metricsStore) GetAuthorizedWorkspaces(ctx context.Context, arg database.GetWorkspacesParams, prepared rbac.PreparedAuthorized) ([]database.GetWorkspacesRow, error) {
	start := time.Now()
	workspaces, err := m.s.GetAuthorizedWorkspaces(ctx, arg, prepared)
	m.queryLatencies.WithLabelValues("GetAuthorizedWorkspaces").Observe(time.Since(start).Seconds())
	return workspaces, err
}

func (m metricsStore) GetAuthorizedUsers(ctx context.Context, arg database.GetUsersParams, prepared rbac.PreparedAuthorized) ([]database.GetUsersRow, error) {
	start := time.Now()
	r0, r1 := m.s.GetAuthorizedUsers(ctx, arg, prepared)
	m.queryLatencies.WithLabelValues("GetAuthorizedUsers").Observe(time.Since(start).Seconds())
	return r0, r1
}
