Skip to content

Commit 25dbfa5

Browse files
authored
Remove metrics collection option (#109)
1 parent 674d478 commit 25dbfa5

File tree

17 files changed

+0
-1123
lines changed

17 files changed

+0
-1123
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ You can also set up file path filters to avoid exporting unwanted archives or ma
103103
| `mapping_file_exclude_filter` | The Step will **not** copy the generated mapping files that match this filter into the Bitrise deploy directory. You can use this input to avoid moving a beta mapping file, for example. If you specify an empty filter, every mapping file (selected by `mapping_file_include_filter`) will be copied. Example: Do not copy any mapping.txt file that is in a `beta` directoy: ``` */beta/mapping.txt ``` | | `*/tmp/*` |
104104
| `cache_level` | `all` - will cache build-cache and dependencies `only_deps` - will cache dependencies only `none` - won't cache any of the above | required | `only_deps` |
105105
| `gradle_options` | Flags added to the end of the Gradle call. You can use multiple options, separated by a space. Example: `--stacktrace --debug` If `--debug` or `-d` options are set then only the last 20 lines of the raw gradle output will be visible in the build log. The full raw output will be exported to the `$BITRISE_GRADLE_RAW_RESULT_TEXT_PATH` variable and will be added as a build artifact. | | `--stacktrace` |
106-
| `collect_metrics` | Enable Gradle metrics collection and send data to Bitrise. | | `no` |
107106
</details>
108107

109108
<details>

main.go

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@ import (
1616
"github.com/bitrise-io/go-utils/log"
1717
"github.com/bitrise-io/go-utils/pathutil"
1818
"github.com/bitrise-io/go-utils/retry"
19-
v2command "github.com/bitrise-io/go-utils/v2/command"
20-
"github.com/bitrise-io/go-utils/v2/env"
21-
v2errorutil "github.com/bitrise-io/go-utils/v2/errorutil"
22-
v2log "github.com/bitrise-io/go-utils/v2/log"
23-
v2pathutil "github.com/bitrise-io/go-utils/v2/pathutil"
24-
"github.com/bitrise-steplib/steps-gradle-runner/metrics"
2519
"github.com/kballard/go-shellquote"
2620
)
2721

@@ -50,9 +44,6 @@ type Config struct {
5044

5145
// Other configs
5246
DeployDir string `env:"BITRISE_DEPLOY_DIR"`
53-
54-
// Metrics
55-
CollectMetrics bool `env:"collect_metrics,opt[yes,no]"`
5647
}
5748

5849
func runGradleTask(gradleTool, buildFile, tasks, options string, destDir string) error {
@@ -196,23 +187,6 @@ func main() {
196187
failf("Failed to add executable permission on gradlew file (%s): %s", gradlewPath, err)
197188
}
198189

199-
// Enable metrics collection
200-
envRepo := env.NewRepository()
201-
cmdFactory := v2command.NewFactory(envRepo)
202-
pathProvider := v2pathutil.NewPathProvider()
203-
logger := v2log.NewLogger()
204-
collector := metrics.NewCollector(envRepo, cmdFactory, pathProvider, logger, gradlewPath, configs.GradleFile)
205-
if configs.CollectMetrics && collector.CanBeEnabled(configs.GradleOptions) {
206-
err = collector.SetupMetricsCollection()
207-
if err == nil {
208-
configs.GradleOptions = collector.UpdateGradleFlagsWithInitScript(configs.GradleOptions)
209-
log.Donef("Metrics collection is set up")
210-
} else {
211-
log.Warnf(v2errorutil.FormattedError(err))
212-
log.Infof("Continuing task execution without metrics collection")
213-
}
214-
}
215-
216190
gradleStarted := time.Now()
217191

218192
log.Infof("Running gradle task...")
@@ -405,15 +379,4 @@ func main() {
405379
}
406380
log.Donef("The mapping path is now available in the Environment Variable: $BITRISE_MAPPING_PATH (value: %s)", lastCopiedMappingFile)
407381
}
408-
409-
if configs.CollectMetrics {
410-
log.Printf("\n")
411-
log.Infof("Sending collected metrics...")
412-
err := collector.SendMetrics()
413-
if err != nil {
414-
log.Warnf(v2errorutil.FormattedError(err))
415-
} else {
416-
log.Donef("Done")
417-
}
418-
}
419382
}

metrics/init.gradle.gotemplate

Lines changed: 0 additions & 26 deletions
This file was deleted.

metrics/initscript.go

Lines changed: 0 additions & 46 deletions
This file was deleted.

metrics/initscript_test.go

Lines changed: 0 additions & 85 deletions
This file was deleted.

metrics/metrics.go

Lines changed: 0 additions & 138 deletions
This file was deleted.

step.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -210,14 +210,6 @@ inputs:
210210
You can use multiple options, separated by a space. Example: `--stacktrace --debug`
211211
If `--debug` or `-d` options are set then only the last 20 lines of the raw gradle output will be visible in the build log.
212212
The full raw output will be exported to the `$BITRISE_GRADLE_RAW_RESULT_TEXT_PATH` variable and will be added as a build artifact.
213-
- collect_metrics: "no"
214-
opts:
215-
title: Collect Gradle metrics
216-
description: |
217-
Enable Gradle metrics collection and send data to Bitrise.
218-
value_options:
219-
- "yes"
220-
- "no"
221213
outputs:
222214
- BITRISE_APK_PATH:
223215
opts:

0 commit comments

Comments
 (0)