forked from openfresh/wse-rest-library-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstatistics_test.go
54 lines (43 loc) · 1.12 KB
/
statistics_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package wserest
import (
"testing"
"github.com/sebastien4/wse-rest-library-go/entity/application/helper"
)
func TestStatistics(t *testing.T) {
// Create settings
settings := helper.NewDefaultSettings()
settings.SetHost(WowzaHost)
settings.SetUseDigest(true)
settings.SetUsername(WowzaUsername)
settings.SetPassword(WowzaPassword)
sf := NewStatistics(settings)
if UseWowza == "" {
return
}
// get stats per application
wowzaApplication := NewApplication(settings, "vod", "", "", "", "")
// get total server stats
server := NewServer(settings)
response, err := sf.GetServerStatistics(server)
if err != nil {
t.Fatal(err)
}
t.Log(response)
// get stats historical for given application
response, err = sf.GetApplicationStatisticsHistory(wowzaApplication)
if err != nil {
t.Fatal(err)
}
t.Log(response)
response, err = sf.GetApplicationStatistics(wowzaApplication)
if err != nil {
t.Fatal(err)
}
t.Log(response)
// get incoming stream stats for given application
response, err = sf.GetIncomingApplicationStatistics(wowzaApplication, "sample.mp4", "")
if err != nil {
t.Fatal(err)
}
t.Log(response)
}