refactor: move uixt pkg

This commit is contained in:
lilong.129
2025-03-05 11:04:02 +08:00
parent 9e064ee0ad
commit e107389d6e
122 changed files with 146 additions and 142 deletions
+36
View File
@@ -0,0 +1,36 @@
package httpstat
import (
"fmt"
"net/http"
"testing"
"time"
)
func TestMain(t *testing.T) {
var httpStat Stat
req, _ := http.NewRequest("GET", "https://httprunner.com", nil)
ctx := WithHTTPStat(req, &httpStat)
client := &http.Client{
Timeout: time.Second * 10,
}
req = req.WithContext(ctx)
resp, err := client.Do(req)
if err != nil {
t.Fatal(err)
}
if resp != nil {
defer resp.Body.Close()
}
// get stat
httpStat.Finish()
result := httpStat.Durations()
fmt.Println(result)
// print stat
httpStat.Print()
}