Skip to content
This repository was archived by the owner on Jan 24, 2024. It is now read-only.

Conversation

@vaizramez
Copy link

In base_measurer.go, using "mongodbatlas.Process" package derived additional labels as below,

TypeName: strings.Split(p.TypeName, "_")[1],
Sharded_cluster: strings.Split(p.ReplicaSetName, "-")[0] + "-" + strings.Split(p.ReplicaSetName, "-")[1],
Project_name: strings.Split(p.UserAlias, "-")[0] + "-" + strings.Split(p.UserAlias, "-")[1],

@vaizramez vaizramez requested a review from a team as a code owner April 28, 2022 12:06
TypeName: strings.Split(p.TypeName, "_")[1],
Hostname: p.Hostname,
ID: p.ID,
Sharded_cluster: strings.Split(p.ReplicaSetName, "-")[0] + "-" + strings.Split(p.ReplicaSetName, "-")[1],
Copy link

Choose a reason for hiding this comment

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

Here is some more elegant way to cut the suffix, if it's really necessary:

Suggested change
Sharded_cluster: strings.Split(p.ReplicaSetName, "-")[0] + "-" + strings.Split(p.ReplicaSetName, "-")[1],
Sharded_cluster: strings.Join(strings.Split(p.ReplicaSetName, "-")[:2], "-"),

Hostname: p.Hostname,
ID: p.ID,
Sharded_cluster: strings.Split(p.ReplicaSetName, "-")[0] + "-" + strings.Split(p.ReplicaSetName, "-")[1],
Project_name: strings.Split(p.UserAlias, "-")[0] + "-" + strings.Split(p.UserAlias, "-")[1],
Copy link

@n3ph n3ph May 2, 2022

Choose a reason for hiding this comment

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

Same here:

Suggested change
Project_name: strings.Split(p.UserAlias, "-")[0] + "-" + strings.Split(p.UserAlias, "-")[1],
Project_name: strings.Join(strings.Split(p.UserAlias, "-")[:2], "-"),

Hostname: p.Hostname,
ID: p.ID,
UserAlias: p.UserAlias + fmt.Sprintf(":%d", p.Port),
TypeName: strings.Split(p.TypeName, "_")[1],
Copy link

Choose a reason for hiding this comment

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

Don't know if we depend on the full TypeName ATM.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants