MCPcopy Create free account
hub / github.com/google/pprof / TestNumLabelUnits

Function TestNumLabelUnits

profile/profile_test.go:1741–1856  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1739}
1740
1741func TestNumLabelUnits(t *testing.T) {
1742 var tagFilterTests = []struct {
1743 desc string
1744 tagVals []map[string][]int64
1745 tagUnits []map[string][]string
1746 wantUnits map[string]string
1747 wantIgnoredUnits map[string][]string
1748 }{
1749 {
1750 "One sample, multiple keys, different specified units",
1751 []map[string][]int64{{"key1": {131072}, "key2": {128}}},
1752 []map[string][]string{{"key1": {"bytes"}, "key2": {"kilobytes"}}},
1753 map[string]string{"key1": "bytes", "key2": "kilobytes"},
1754 map[string][]string{},
1755 },
1756 {
1757 "One sample, one key with one value, unit specified",
1758 []map[string][]int64{{"key1": {8}}},
1759 []map[string][]string{{"key1": {"bytes"}}},
1760 map[string]string{"key1": "bytes"},
1761 map[string][]string{},
1762 },
1763 {
1764 "One sample, one key with one value, empty unit specified",
1765 []map[string][]int64{{"key1": {8}}},
1766 []map[string][]string{{"key1": {""}}},
1767 map[string]string{"key1": "key1"},
1768 map[string][]string{},
1769 },
1770 {
1771 "Key bytes, unit not specified",
1772 []map[string][]int64{{"bytes": {8}}},
1773 []map[string][]string{nil},
1774 map[string]string{"bytes": "bytes"},
1775 map[string][]string{},
1776 },
1777 {
1778 "One sample, one key with one value, unit not specified",
1779 []map[string][]int64{{"kilobytes": {8}}},
1780 []map[string][]string{nil},
1781 map[string]string{"kilobytes": "kilobytes"},
1782 map[string][]string{},
1783 },
1784 {
1785 "Key request, unit not specified",
1786 []map[string][]int64{{"request": {8}}},
1787 []map[string][]string{nil},
1788 map[string]string{"request": "bytes"},
1789 map[string][]string{},
1790 },
1791 {
1792 "Key alignment, unit not specified",
1793 []map[string][]int64{{"alignment": {8}}},
1794 []map[string][]string{nil},
1795 map[string]string{"alignment": "bytes"},
1796 map[string][]string{},
1797 },
1798 {

Callers

nothing calls this directly

Calls 1

NumLabelUnitsMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…