MCPcopy Create free account
hub / github.com/GitbookIO/micro-analytics / shardNameToInt

Function shardNameToInt

database/sqlite/sharded.go:597–602  ·  view source on GitHub ↗

Convert a shard name to an int 2015-12 -> 201512

(shardName string)

Source from the content-addressed store, hash-verified

595// Convert a shard name to an int
596// 2015-12 -> 201512
597func shardNameToInt(shardName string) (int, error) {
598 parts := strings.Split(shardName, "-")
599 shardName = strings.Join(parts, "")
600 shardInt, err := strconv.Atoi(shardName)
601 return shardInt, err
602}
603
604// Return the list of all shards in a DBPath
605func listShards(dbPath manager.DBPath) []string {

Callers 5

QueryMethod · 0.85
CountMethod · 0.85
GroupByMethod · 0.85
SeriesMethod · 0.85
formatURLForCacheFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected