Skip to content
This repository was archived by the owner on Aug 23, 2023. It is now read-only.

Added substr and aliasByMetric functions#1318

Closed
the-real-stiven wants to merge 5 commits intografana:masterfrom
the-real-stiven:substr
Closed

Added substr and aliasByMetric functions#1318
the-real-stiven wants to merge 5 commits intografana:masterfrom
the-real-stiven:substr

Conversation

@the-real-stiven
Copy link
Copy Markdown

Native implementation of substr() and aliasByMetric() Graphite functions.

right = len(serie.Target)
}
cleanName := serie.Target[left:right]
cleanName = strings.SplitN(cleanName, ",", 2)[0]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is another one that likely should be updated in graphite-web to use _getFirstPathExpression for consistency with the way we get nodes in aliasByNode etc. This implementation is consistent with what's in graphite-web today though.

return nil, err
}

out := make([]models.Series, len(series))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

functions that do not affect the datapoints slices (eg that only change the names/tags), don't need to allocate new output series, and don't add them to the cache either (because we currently only use the cache to mark what needs to be returned the pool). i know this is confusing, you may want to freshen up on devdocs/expr.md

@stale
Copy link
Copy Markdown

stale bot commented Apr 4, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 4, 2020
@Dieterbe Dieterbe removed the stale label Apr 7, 2020
@stale
Copy link
Copy Markdown

stale bot commented Jul 6, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 6, 2020
@stale stale bot closed this Jul 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants