Skip to content

Commit

Permalink
統計情報修正
Browse files Browse the repository at this point in the history
  • Loading branch information
tukeJonny committed Nov 1, 2023
1 parent 9c8b21f commit 10bb31c
Show file tree
Hide file tree
Showing 8 changed files with 286 additions and 132 deletions.
23 changes: 10 additions & 13 deletions bench/isupipe/client_stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,19 @@ import (
)

type LivestreamStatistics struct {
MostTipRanking []TipRank `json:"most_tip_ranking"`
MostPostedReactionRanking []ReactionRank `json:"most_posted_reaction_ranking"`
Rank int64 `json:"rank"`
ViewersCount int64 `json:"viewers_count"`
TotalReactions int64 `json:"total_reactions"`
TotalReports int64 `json:"total_reports"`
MaxTip int64 `json:"max_tip"`
}

type UserStatistics struct {
TipRankPerLivestreams map[int]TipRank `json:"tip_rank_by_livestream"`
}

type TipRank struct {
Rank int `json:"tip_rank"`
TotalTip int `json:"total_tip"`
}

type ReactionRank struct {
Rank int `json:"reaction_rank"`
EmojiName string `json:"emoji_name"`
Rank int64 `json:"rank"`
ViewersCount int64 `json:"viewers_count"`
TotalReactions int64 `json:"total_reactions"`
TotalLivecomments int64 `json:"total_livecomments"`
TotalTip int64 `json:"total_tip"`
}

func (c *Client) GetUserStatistics(ctx context.Context, username string, opts ...ClientOption) (*UserStatistics, error) {
Expand Down
3 changes: 0 additions & 3 deletions bench/isupipe/client_user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ func TestClientUser_Login(t *testing.T) {
)
assert.NoError(t, err)

_, err = client.Initialize(ctx)
assert.NoError(t, err)

streamer := scheduler.UserScheduler.GetRandomStreamer()
assert.NoError(t, err)

Expand Down
27 changes: 27 additions & 0 deletions bench/isupipe/main_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package isupipe

import (
"context"
"log"
"testing"
"time"

"github.com/isucon/isucandar/agent"
"github.com/isucon/isucon13/bench/internal/config"
)

func TestMain(m *testing.M) {
client, err := NewClient(
agent.WithBaseURL(config.TargetBaseURL),
agent.WithTimeout(1*time.Minute),
)
if err != nil {
log.Fatalln(err)
}

if _, err := client.Initialize(context.Background()); err != nil {
log.Fatalln(err)
}

m.Run()
}
7 changes: 0 additions & 7 deletions docs/reservation.md

This file was deleted.

25 changes: 25 additions & 0 deletions docs/specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,28 @@ ISUPipeでは、治安維持のため、配信者が個人個人でスパム対


* シーズン4

# 配信予約

## ベンチマーカーが予約する時間の粒度について

最小単位は1h。

のちほどこれでは不足するようならより細かい粒度も検討する

# チップの概念について

isupipeでは、行われている配信に対してライブコメントを投稿することができ、
ライブコメントにはチップ(tips)が含まれます。
これは、一般的に投げ銭システムと呼ばれるものです。

isupipeでは、このtipsについて、以下のようなレベル分けを行っております。

|金額帯||
|:--:|:--:|
|1 ~ 499||
|500 ~ 999 ||
|1000 ~ 4999| 黄色 |
|5000 ~ 9999 | オレンジ |
|10000 ~ 20000 ||

16 changes: 0 additions & 16 deletions docs/tips.md

This file was deleted.

28 changes: 28 additions & 0 deletions docs/transplant.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 移植マニュアル


## Webappについて




## self-hosted runnerについて




## 関連するミドルウェアについて




## CI実行方法について




## ベンチマーカーで発生するエラーについて

エラーには以下のような種類があります

うち、移植失敗の可能性を示唆するものは以下のとおりです
Loading

0 comments on commit 10bb31c

Please sign in to comment.