本文整理匯總了Golang中github.com/Symantec/scotty/store.Store.LatestByPrefixAndEndpointStrategy方法的典型用法代碼示例。如果您正苦於以下問題:Golang Store.LatestByPrefixAndEndpointStrategy方法的具體用法?Golang Store.LatestByPrefixAndEndpointStrategy怎麽用?Golang Store.LatestByPrefixAndEndpointStrategy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/Symantec/scotty/store.Store
的用法示例。
在下文中一共展示了Store.LatestByPrefixAndEndpointStrategy方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: latestMetricsForEndpoint
func latestMetricsForEndpoint(
metricStore *store.Store,
app *datastructs.ApplicationStatus,
canonicalPath string,
json bool) (result []*messages.LatestMetric) {
var appender store.Appender
if json {
appender = &latestMetricsAppenderJSON{
result: &result,
hostName: app.EndpointId.HostName(),
appName: app.Name,
}
} else {
appender = &latestMetricsAppender{
result: &result,
hostName: app.EndpointId.HostName(),
appName: app.Name,
}
}
metricStore.LatestByPrefixAndEndpointStrategy(
canonicalPath,
app.EndpointId,
store.GroupMetricByPathAndNumeric,
store.AppenderFilterFunc(
appender,
func(r *store.Record) bool {
return r.Info.Path() == canonicalPath || strings.HasPrefix(
r.Info.Path(), canonicalPath+"/")
},
),
)
sort.Sort(latestByPath(result))
return
}