Skip to content

Commit

Permalink
Revert "backport of commit e3c5977 (#19629)"
Browse files Browse the repository at this point in the history
This reverts commit acb9d7c.
  • Loading branch information
miagilepner committed Apr 13, 2023
1 parent 5d13255 commit 47a8b2f
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 39 deletions.
23 changes: 0 additions & 23 deletions vault/activity_log.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,6 @@ type ActivityLog struct {
partialMonthClientTracker map[string]*activity.EntityRecord

inprocessExport *atomic.Bool

// CensusReportDone is a channel used to signal tests upon successful calls
// to (CensusReporter).Write() in CensusReport.
CensusReportDone chan bool

// CensusReportInterval is the testing configuration for time between
// Write() calls initiated in CensusReport.
CensusReportInterval time.Duration
}

// These non-persistent configuration options allow us to disable
Expand All @@ -190,9 +182,6 @@ type ActivityLogCoreConfig struct {

// Do not start timers to send or persist fragments.
DisableTimers bool

// CensusReportInterval is the testing configuration for time
CensusReportInterval time.Duration
}

// NewActivityLog creates an activity log.
Expand All @@ -214,7 +203,6 @@ func NewActivityLog(core *Core, logger log.Logger, view *BarrierView, metrics me
writeCh: make(chan struct{}, 1), // same for full segment
doneCh: make(chan struct{}, 1),
partialMonthClientTracker: make(map[string]*activity.EntityRecord),
CensusReportInterval: time.Hour * 1,

currentSegment: segmentInfo{
startTimestamp: 0,
Expand Down Expand Up @@ -952,10 +940,6 @@ func (a *ActivityLog) SetConfigInit(config activityConfig) {

a.defaultReportMonths = config.DefaultReportMonths
a.retentionMonths = config.RetentionMonths

if a.configOverrides.CensusReportInterval > 0 {
a.CensusReportInterval = a.configOverrides.CensusReportInterval
}
}

// This version reacts to user changes
Expand Down Expand Up @@ -1092,9 +1076,6 @@ func (c *Core) setupActivityLog(ctx context.Context, wg *sync.WaitGroup) error {
manager.retentionWorker(ctx, time.Now(), months)
close(manager.retentionDone)
}(manager.retentionMonths)

manager.CensusReportDone = make(chan bool)
go c.activityLog.CensusReport(ctx, c.censusAgent)
}

return nil
Expand Down Expand Up @@ -1595,9 +1576,7 @@ func (a *ActivityLog) handleQuery(ctx context.Context, startTime, endTime time.T
if computePartial {
// Traverse through current month's activitylog data and group clients
// into months and namespaces
a.fragmentLock.RLock()
partialByMonth, partialByNamespace = a.populateNamespaceAndMonthlyBreakdowns()
a.fragmentLock.RUnlock()

// Convert the byNamespace breakdowns into structs that are
// consumable by the /activity endpoint, so as to reuse code between these two
Expand Down Expand Up @@ -1781,8 +1760,6 @@ type activityConfig struct {

// Enabled is one of enable, disable, default.
Enabled string `json:"enabled"`

CensusReportInterval time.Duration `json:"census_report_interval"`
}

func defaultActivityConfig() activityConfig {
Expand Down
3 changes: 0 additions & 3 deletions vault/activity_log_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,3 @@ import "context"
func (a *ActivityLog) sendCurrentFragment(ctx context.Context) error {
return nil
}

// CensusReport is a no-op on OSS
func (a *ActivityLog) CensusReport(_ctx context.Context, _ca *CensusAgent) {}
6 changes: 0 additions & 6 deletions vault/census.go

This file was deleted.

6 changes: 0 additions & 6 deletions vault/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -638,9 +638,6 @@ type Core struct {

activityLogConfig ActivityLogCoreConfig

// censusAgent is the mechanism used for reporting Vault's billing data.
censusAgent *CensusAgent

// activeTime is set on active nodes indicating the time at which this node
// became active.
activeTime time.Time
Expand Down Expand Up @@ -807,9 +804,6 @@ type CoreConfig struct {
LicensePath string
LicensingConfig *LicensingConfig

// Configured Census Agent
censusAgent *CensusAgent

DisablePerformanceStandby bool
DisableIndexing bool
DisableKeyEncodingChecks bool
Expand Down
1 change: 0 additions & 1 deletion vault/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ func TestCoreWithSealAndUINoCleanup(t testing.T, opts *CoreConfig) *Core {
conf.PluginDirectory = opts.PluginDirectory
conf.DetectDeadlocks = opts.DetectDeadlocks
conf.Experiments = []string{experiments.VaultExperimentEventsAlpha1}
conf.censusAgent = opts.censusAgent

if opts.Logger != nil {
conf.Logger = opts.Logger
Expand Down

0 comments on commit 47a8b2f

Please sign in to comment.