generated from cortinico/kotlin-gradle-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove Tracks-related networking code. Introduce AppsMetric networkin…
…g contract. Also, attach SHA-1 of user name.
- Loading branch information
Showing
12 changed files
with
162 additions
and
84 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
appsMetricsToken = foobar |
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
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
20 changes: 20 additions & 0 deletions
20
...ain/java/io/github/wzieba/tracks/plugin/analytics/networking/AppsMetricsGroupedMetrics.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,20 @@ | ||
package io.github.wzieba.tracks.plugin.analytics.networking | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class GroupedAppsMetrics( | ||
@SerialName("meta") | ||
val meta: List<AppsMetric>, | ||
@SerialName("metrics") | ||
val metrics: List<AppsMetric>, | ||
) | ||
|
||
@Serializable | ||
data class AppsMetric( | ||
@SerialName("name") | ||
val name: String, | ||
@SerialName("value") | ||
val value: String, | ||
) |
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
103 changes: 103 additions & 0 deletions
103
...n/src/main/java/io/github/wzieba/tracks/plugin/analytics/networking/ToAppsInfraPayload.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,103 @@ | ||
package io.github.wzieba.tracks.plugin.analytics.networking | ||
|
||
import io.github.wzieba.tracks.plugin.BuildData | ||
|
||
@Suppress("LongMethod") | ||
fun BuildData.toAppsInfraPayload(user: String) = GroupedAppsMetrics( | ||
meta = listOf( | ||
AppsMetric( | ||
name = "User", | ||
value = user | ||
), | ||
AppsMetric( | ||
name = "Project", | ||
value = this.forProject.name | ||
) | ||
), | ||
metrics = listOf( | ||
AppsMetric( | ||
name = "Requested tasks", | ||
value = this.tasks.joinToString(separator = ",") | ||
), | ||
AppsMetric( | ||
name = "Performed Gradle action", | ||
value = this.action | ||
), | ||
AppsMetric( | ||
name = "Build time (ms)", | ||
value = this.buildTime.toString() | ||
), | ||
AppsMetric( | ||
name = "Build status", | ||
value = if (this.failed) "Failure" else "Success" | ||
), | ||
AppsMetric( | ||
name = "Failure message", | ||
value = this.failure.toString() | ||
), | ||
AppsMetric( | ||
name = "Number of running daemons", | ||
value = this.daemonsRunning.toString() | ||
), | ||
AppsMetric( | ||
name = "Daemon's build count", | ||
value = this.thisDaemonBuilds.toString() | ||
), | ||
AppsMetric( | ||
name = "Gradle version", | ||
value = this.gradleVersion | ||
), | ||
AppsMetric( | ||
name = "Operating system", | ||
value = this.operatingSystem | ||
), | ||
AppsMetric( | ||
name = "Environment", | ||
value = this.environment.toString() | ||
), | ||
AppsMetric( | ||
name = "Total number of tasks", | ||
value = this.taskStatistics.total.toString() | ||
), | ||
AppsMetric( | ||
name = "Up to date tasks", | ||
value = this.taskStatistics.upToDate.toString() | ||
), | ||
AppsMetric( | ||
name = "Tasks from cache", | ||
value = this.taskStatistics.fromCache.toString() | ||
), | ||
AppsMetric( | ||
name = "Executed tasks", | ||
value = this.taskStatistics.executed.toString() | ||
), | ||
AppsMetric( | ||
name = "Is configure on demand", | ||
value = this.isConfigureOnDemand.toString() | ||
), | ||
AppsMetric( | ||
name = "Is configuration cache", | ||
value = this.isConfigurationCache.toString() | ||
), | ||
AppsMetric( | ||
name = "Is build cache", | ||
value = this.isBuildCache.toString() | ||
), | ||
AppsMetric( | ||
name = "Max workers", | ||
value = this.maxWorkers.toString() | ||
), | ||
AppsMetric( | ||
name = "Build data collection overhead", | ||
value = this.buildDataCollectionOverhead.toString() | ||
), | ||
AppsMetric( | ||
name = "Included builds", | ||
value = this.includedBuildsNames.joinToString(separator = ",").ifEmpty { "none" } | ||
), | ||
AppsMetric( | ||
name = "Architecture", | ||
value = this.architecture | ||
), | ||
) | ||
) |
42 changes: 0 additions & 42 deletions
42
...ugin/src/main/java/io/github/wzieba/tracks/plugin/analytics/networking/ToNosaraPayload.kt
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
...plugin/src/main/java/io/github/wzieba/tracks/plugin/analytics/networking/TracksPayload.kt
This file was deleted.
Oops, something went wrong.