<commit_before>package ucloud

import (
	_ "fmt"
	_ "testing"
)

/*
func TestGetMetric(t *testing.T) {

	g := GetMetric{Region: "cn-east-01",
		MetricName:   []string{"NetworkOut", "TotalNetworkOut"},
		ResourceId:   "uhost-ahdvfh",
		ResourceType: "uhost"}
	rsp, err := u.Do(&g)
	if err != nil || !rsp.OK() {
		t.Fatal(err, rsp)
	}
	data := rsp.Data().(map[string]*GetMetricItem)
	fmt.Println(data["NetworkOut"])
}
*/
<commit_msg>update Umon<commit_after>package ucloud

import (
	"fmt"
	"testing"
)

// ---------------- TestGetMetric ------------------
func TestGetMetric(t *testing.T) {
	fmt.Println("UMon....")
	r := &GetMetric{ResourceType: "ulb",
		ResourceId: "ulb-kix4tp",
		Region:     "1",
		TimeRange:  300,
		MetricName: []string{"NetworkOut", "TotalNetworkOut"},
	}
	cmp := `https://api.ucloud.cn/?Action=GetMetric&Region=1&MetricName.0=NetworkOut&MetricName.1=TotalNetworkOut&ResourceType=ulb&ResourceId=ulb-kix4tp&TimeRange=300`

	if err := FakeGetAndCmp(r, cmp); err != nil {
		t.Fatal(err)
	}
}

{'fraction_non_alphanumeric': 0.21541501976284586, 'fraction_numerical': 0.01383399209486166, 'mean_word_length': 3.9414634146341463, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1588699', 'n_tokens_mistral': 418, 'n_tokens_neox': 399, 'n_words': 62}