(indexName, sourceName, params string)
| 164 | } |
| 165 | |
| 166 | func getNsIndexStatsKey(indexName, sourceName, params string) string { |
| 167 | var colNames string |
| 168 | // look up the scope/collection details from the cache. |
| 169 | sname, cnames := metaFieldValCache.getScopeCollectionNames(indexName) |
| 170 | // compute afresh for a cache miss. |
| 171 | if len(sname) == 0 && len(cnames) == 0 { |
| 172 | sname, cnames = scopeCollNames(params, sourceName) |
| 173 | if sname == "" && len(cnames) == 0 { |
| 174 | sname = "_default" |
| 175 | cnames = []string{"_default"} |
| 176 | } |
| 177 | } |
| 178 | |
| 179 | for i, colName := range cnames { |
| 180 | if i > 0 { |
| 181 | colName = "," + colName |
| 182 | } |
| 183 | colNames += colName |
| 184 | } |
| 185 | |
| 186 | return ` {bucket="` + sourceName + `",scope="` + sname + `"` + |
| 187 | `,collection="` + colNames + `",index="` + indexName + `"}` |
| 188 | } |
| 189 | |
| 190 | // PrometheusMetricsHandler is a REST handler that provides low |
| 191 | // cardinality stats/metrics for consumption by ns_server/prometheus. |
no test coverage detected