-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Compute statistics on time for each widget.
- Loading branch information
1 parent
3a6bd13
commit 59018c9
Showing
11 changed files
with
203 additions
and
21 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
src/backend-api/src/main/kotlin/org/icpclive/api/WidgetUsageStatistics.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package org.icpclive.api | ||
|
||
import kotlinx.serialization.* | ||
import org.icpclive.cds.api.TeamId | ||
import org.icpclive.cds.util.serializers.DurationInSecondsSerializer | ||
import kotlin.time.* | ||
|
||
@Serializable | ||
data class WidgetUsageStatistics( | ||
val entries: MutableMap<String, WidgetUsageStatisticsEntry> | ||
) | ||
|
||
@Serializable | ||
sealed class WidgetUsageStatisticsEntry { | ||
@Serializable | ||
@SerialName("simple") | ||
data class Simple( | ||
@Transient val shownSince: TimeSource.Monotonic.ValueTimeMark? = null, | ||
@Transient val shownCount: Int = 0, | ||
@Serializable(with = DurationInSecondsSerializer::class) | ||
@SerialName("totalShownTimeSeconds") | ||
val totalShownTime: Duration | ||
) : WidgetUsageStatisticsEntry() | ||
@Serializable | ||
@SerialName("per_team") | ||
data class PerTeam(val byTeam: Map<TeamId, WidgetUsageStatisticsEntry>): WidgetUsageStatisticsEntry() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
src/backend/src/main/kotlin/org/icpclive/controllers/TeamViewController.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 87 additions & 0 deletions
87
src/backend/src/main/kotlin/org/icpclive/data/WidgetManager.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.