| 825 | } |
| 826 | |
| 827 | func convertStatName(key string) string { |
| 828 | lastSlash := strings.LastIndex(key, "/") |
| 829 | if lastSlash < 0 { |
| 830 | return "unknown" |
| 831 | } |
| 832 | statSuffix := key[lastSlash+1:] |
| 833 | if fixedStatName, ok := fixedSuffixToStatNameMapping[statSuffix]; ok { |
| 834 | return fixedStatName |
| 835 | } |
| 836 | statNameStart := strings.LastIndex(key[:lastSlash], "/") |
| 837 | if statNameStart < 0 { |
| 838 | return "unknown" |
| 839 | } |
| 840 | statPrefix := key[statNameStart+1 : lastSlash] |
| 841 | if statPrefix == "basic" { |
| 842 | statPrefix = "" |
| 843 | } |
| 844 | statName := camelToUnderscore(statSuffix) |
| 845 | if statPrefix != "" { |
| 846 | statName = camelToUnderscore(statPrefix) + "_" + statName |
| 847 | } |
| 848 | return statName |
| 849 | } |
| 850 | |
| 851 | func camelToUnderscore(name string) string { |
| 852 | rv := "" |