8000 update readme by cdsap · Pull Request #368 · cdsap/Talaiot · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

update readme #368

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,15 @@ jobs:
name: assemble
command: ./gradlew assemble
- run:
name: test
name: test plugins
command: |
java --version
./gradlew collectUnitTest --stacktrace --info
- run:
name: test libs
command: |
java --version
./gradlew collectUnitTest --stacktrace --info
./gradlew collectUnitTestLibs --stacktrace --info
- run:
name: build sample
command: |
Expand Down
29 changes: 1 addition & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ Current available plugins:
| standard | Contains all the available publishers listed below |
| base | Talaiot core functionality with Json, Output and Timeline publishers |
| elasticsearch | Talaiot core functionality with Elasticsearch publisher |
| graph | Talaiot core functionality with Graph publisher |
| influxdb | Talaiot core functionality with Influxdb publisher |
| influxdb2 | Talaiot core functionality with Influxdb2 (Flux) publisher |
| pushgateway | Talaiot core functionality with Pushgateway publisher |
Expand Down Expand Up @@ -103,7 +102,6 @@ Each plugin is deployed to the Gradle Plugin Portal using thee following convent
|----------------|-----------------------------------------|
| base | io.github.cdsap.talaiot.plugin.base |
| elasticsearch | io.github.cdsap.talaiot.plugin.elasticsearch |
| graph | io.github.cdsap.talaiot.plugin.graph |
| influxdb | io.github.cdsap.talaiot.plugin.influxdb |
| pushgateway | io.github.cdsap.talaiot.plugin.pushgateway |
| rethinkdb | io.github.cdsap.talaiot.plugin.rehinkdb |
Expand Down Expand Up @@ -214,7 +212,7 @@ talaiot {
Read more about it in the [Metrics wiki page](https://github.com/cdsap/Talaiot/wiki/Metrics).

### Filters
For every measurement done, Talaiot can filter the tasks tracked to be published. These filters don't apply to GraphPublishers:
For every measurement done, Talaiot can filter the tasks tracked to be published.


| Property | Description |
Expand Down Expand Up @@ -373,31 +371,6 @@ influxDbPublisher {
}
```

#### TaskDependencyGraphPublisher
Talaiot will generate the Task Dependency Graph in the specific format specified in the configuration


| Property | Description |
|---------------|--------------------------------------------------------------------------------------------------|
| ignoreWhen | Configuration to ignore the execution of the publisher |
| html | Export the task dependency graph in Html format with support of [vis.js](http://visjs.org/) |
| gexf | Export the task dependency graph in [gexf format](https://gephi.org/gexf/format/) |
| dot | Export the task dependency graph in png format. See [Graphviz](https://graphviz.gitlab.io/) |

This new category of publishers does not require constantly evaluating the builds, that's why there is an extra
parameter configuration in the Publisher to ignore the execution unless there is some property enabled. Typical use case is
use this publisher and collect the files on CI.

The output will be found `"${project.rootDir}/talaiot`:

![](resources/output_graph_publisher.png)

Example:

![](resources/graph_example_plaid.png)

Included in: `io.github.cdsap.talaiot` and `io.github.cdsap.talaiot.plugin.graph` plugins.

#### PushGatewayPublisher
Talaiot will send to the PushGateway server defined in the configuration the values collected during the execution.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class TalaiotKotlinLibPlugin : Plugin<Project> {
val extension = extensions.getByType<BaseConfiguration>()
setProjectVersion(extension.version)
setProjectGroup(extension.group, Type.LIBRARY)
collectUnitTest()
collectUnitTestLibs()
setUpPublishing(Type.LIBRARY)
setUpSigning("TalaiotLib")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,30 @@ fun Project.collectUnitTest() = this.run {
val pr = this
testTask.configure(closureOf<TestReport> {
group = "Verification"
description = "Collect all tests"
description = "Collect plugin tests"

val testTask = pr.tasks.find { it.name == "test" }
testTask?.let { reportOn(testTask) }
destinationDir = file("${rootProject.buildDir}/reports/tests")
})

}
}

fun Project.collectUnitTestLibs() = this.run {
val testTask = if (rootProject.tasks.findByPath("collectUnitTestLibs") == null) {
rootProject.tasks.create("collectUnitTestLibs", TestReport::class) {
}
} else {
rootProject.tasks["collectUnitTestLibs"]
}
val pr = this
testTask.configure(closureOf<TestReport> {
group = "Verification"
description = "Collect tests libs modules"

val testTask = pr.tasks.find { it.name == "test" }
testTask?.let { reportOn(testTask) }
destinationDir = file("${rootProject.buildDir}/reports/tests")
})

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import org.gradle.api.services.BuildService
import org.gradle.api.services.BuildServiceParameters
import org.gradle.tooling.events.FinishEvent
import org.gradle.tooling.events.OperationCompletionListener
import java.util.concurrent.Executors

/**
* Tracks information of the tasks executed duting the build.
Expand Down Expand Up @@ -49,19 +48,16 @@ abstract class TalaiotBuildService :

override fun close() {

val executor = Executors.newSingleThreadExecutor()
val end = System.currentTimeMillis()

executor.execute {
parameters.publisher.get().publish(
taskLengthList = taskLengthList,
start = start,
configuraionMs = configurationTime,
end = end,
duration = end - start,
success = taskLengthList.none { it.state == TaskMessageState.FAILED }
)
}
parameters.publisher.get().publish(
taskLengthList = taskLengthList,
start = start,
configuraionMs = configurationTime,
end = end,
duration = end - start,
success = taskLengthList.none { it.state == TaskMessageState.FAILED }
)
}

override fun onFinish(event: FinishEvent?) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class DefaultConfigurationSpec : StringSpec({
.withPluginClasspath()
.withGradleVersion(version)
.build()
Thread.sleep(2000)
Thread.sleep(5000)
val reportFile = File(testProjectDir.getRoot(), "build/reports/talaiot/json/data.json")
val report = Gson().fromJson(reportFile.readText(), ExecutionReport::class.java)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class OutputPublisherBuildTest : BehaviorSpec({
.withArguments("assemble")
.withPluginClasspath()
.build()
Thread.sleep(2000)

then("logs are shown in the output with the shrugged") {
assert(result.output.contains("OutputPublisher"))
Expand Down
2 changes: 1 addition & 1 deletion sample/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
0