Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update comments for gotip #482

Merged
merged 1 commit into from
May 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions exporter/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@ func listCollections(ctx context.Context, client *mongo.Client, database string,

// databases returns the list of databases matching the filters.
// - filterInNamespaces: Include only the database names matching the any of the regular expressions in this list.
// Case will be ignored because the function will automatically add the ignore case
// flag to the regular expression.
//
// Case will be ignored because the function will automatically add the ignore case
// flag to the regular expression.
//
// - exclude: List of databases to be excluded. Useful to ignore system databases.
func databases(ctx context.Context, client *mongo.Client, filterInNamespaces []string, exclude []string) ([]string, error) {
opts := &options.ListDatabasesOptions{NameOnly: pointer.ToBool(true), AuthorizedDatabases: pointer.ToBool(true)}
Expand Down
21 changes: 11 additions & 10 deletions exporter/v1_compatibility.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,17 @@ func newToOldMetric(rm *rawMetric, c conversion) *rawMetric {
// should be converted to mongodb_mongod_wiredtiger_cache_bytes with label "type": "total".
// For this conversion, we have the suffixMapping field that holds the mapping for all suffixes.
// Example definition:
// oldName: "mongodb_mongod_wiredtiger_cache_bytes",
// prefix: "mongodb_ss_wt_cache_bytes",
// suffixLabel: "type",
// suffixMapping: map[string]string{
// "bytes_currently_in_the_cache": "total",
// "tracked_dirty_bytes_in_the_cache": "dirty",
// "tracked_bytes_belonging_to_internal_pages_in_the_cache": "internal_pages",
// "tracked_bytes_belonging_to_leaf_pages_in_the_cache": "internal_pages",
// },
// },
//
// oldName: "mongodb_mongod_wiredtiger_cache_bytes",
// prefix: "mongodb_ss_wt_cache_bytes",
// suffixLabel: "type",
// suffixMapping: map[string]string{
// "bytes_currently_in_the_cache": "total",
// "tracked_dirty_bytes_in_the_cache": "dirty",
// "tracked_bytes_belonging_to_internal_pages_in_the_cache": "internal_pages",
// "tracked_bytes_belonging_to_leaf_pages_in_the_cache": "internal_pages",
// },
// },
func createOldMetricFromNew(rm *rawMetric, c conversion) *rawMetric {
suffix := strings.TrimPrefix(rm.fqName, c.prefix)
suffix = strings.TrimPrefix(suffix, "_")
Expand Down
2 changes: 1 addition & 1 deletion internal/tu/docker_inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type HostPort struct {
HostPort string `json:"HostPort"`
}

//nolint
// nolint
type DockerInspectOutput []struct {
ID string `json:"Id"`
Created time.Time `json:"Created"`
Expand Down