All Projects → cdsap → Talaiot

cdsap / Talaiot

Licence: mit
Simple and extensible plugin to track task times in your Gradle Project.

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Talaiot

Gradle Android Command Plugin
Handy commands for testing Android on CI
Stars: ✭ 349 (-15.9%)
Mutual labels:  gradle
Androidautotrack
Android Asm 插桩 教学
Stars: ✭ 378 (-8.92%)
Mutual labels:  gradle
Drawer Behavior
Drawer behavior is a library that provide an extra behavior on drawer, such as, move view or scaling view's height while drawer on slide.
Stars: ✭ 394 (-5.06%)
Mutual labels:  gradle
Stark
Stark is a hot-fix framework for Android. It supports swapping new implementations of classes without restarting a running Android application, and updated Android resources (icons, layout, etc) while only restarting the Android Activity. Most importantly, there is no private API invoked in Stark.
Stars: ✭ 360 (-13.25%)
Mutual labels:  gradle
Calces Gradle Plugin
Android构建工具集:包含快速实现组件化构建脚本,快速实现屏幕最小宽度适配脚本
Stars: ✭ 366 (-11.81%)
Mutual labels:  gradle
Pantheon
An enterprise-grade Java-based, Apache 2.0 licensed Ethereum client
Stars: ✭ 383 (-7.71%)
Mutual labels:  gradle
Hexagon
Hexagon is a microservices toolkit written in Kotlin. Its purpose is to ease the building of services (Web applications, APIs or queue consumers) that run inside a cloud platform.
Stars: ✭ 336 (-19.04%)
Mutual labels:  gradle
Resizer
An image resizing library for Android
Stars: ✭ 406 (-2.17%)
Mutual labels:  gradle
Axion Release Plugin
Gradle release & version management plugin.
Stars: ✭ 372 (-10.36%)
Mutual labels:  gradle
Spring Boot Angular2
spring boot backend, angular2 frontend with webpack, typescript, sass, bootstrap4, karma, jasmine
Stars: ✭ 396 (-4.58%)
Mutual labels:  gradle
Lion
使用Gradle构建,基于Java 8/11/13、SpringBoot 2.2.6.RELEASE、SpringCloud Hoxton.SR2、Spring Cloud Alibaba 2.2.0.RELEASE、MyBatis Plus 3.3.1等核心技术体系实现的一套支持云原生的分布式微服务架构,提供OAuth2/JWT权限认证、分布式事务、灰度、限流、熔断降级、分布式锁、链路追踪、MQ等功能,支持Docker容器化部署、镜像交付、K8S容器编排
Stars: ✭ 360 (-13.25%)
Mutual labels:  gradle
Gradle Kotlin Dsl Migration Guide
The missing migration guide to the Gradle Kotlin DSL
Stars: ✭ 364 (-12.29%)
Mutual labels:  gradle
Gradle Maven Publish Plugin
Gradle plugin that configures an uploadArchives task to automatically upload all of your Java, Kotlin or Android libraries to any Maven instance.
Stars: ✭ 392 (-5.54%)
Mutual labels:  gradle
Samples
JavaFX samples to run with different options and build tools
Stars: ✭ 352 (-15.18%)
Mutual labels:  gradle
Dryrun
☁️ Try the demo project of any Android Library
Stars: ✭ 3,845 (+826.51%)
Mutual labels:  gradle
Awesome Gradle
A curated list of awesome Gradle plugins and resources for a better development workflow automation.
Stars: ✭ 341 (-17.83%)
Mutual labels:  gradle
Retrofit2demo
Stars: ✭ 378 (-8.92%)
Mutual labels:  gradle
Robust
Robust is an Android HotFix solution with high compatibility and high stability. Robust can fix bugs immediately without a reboot.
Stars: ✭ 4,125 (+893.98%)
Mutual labels:  gradle
Gradle Static Analysis Plugin
Easy setup of static analysis tools for Android and Java projects.
Stars: ✭ 398 (-4.1%)
Mutual labels:  gradle
Ms Backend Boilerplates
Boilerplate for Your Server Side(Backend) Application, Java | Spring(Boot, Cloud) | Node.js(Express, Koa, Egg) | Go | Python | DevOps 💫 服务端项目模板
Stars: ✭ 394 (-5.06%)
Mutual labels:  gradle

Talaiot

CircleCI codecov

Talaiot is an extensible library targeting teams using the Gradle Build System. It records build/task duration helping to understand problems of the build and detecting bottlenecks. For every record, it will add additional information defined by default or custom metrics.

Talaiot is compatible with different systems like InfluxDb, Elasticsearch or RethinkDb. You need to use a Plugin to work with Talaiot. You can use the standard plugin, including all the functionality, or if you have a specific requirement with a individual plugin.

Current available plugins:

Plugin Description
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
pushgateway Talaiot core functionality with Pushgateway publisher
rethinkdb Talaiot core functionality with Rethinkdb publisher

Once you have Talaiot integrated you can create dashboards using the build information stored:

What is Talaiot?

"... while some certainly had a defensive purpose, the use of others is not clearly understood. Some believe them to have served the purpose of lookout or signalling towers..."

https://en.wikipedia.org/wiki/Talaiot

Table of Contents

  1. Setup
  2. Snapshots
  3. Basic Configuration
  4. Talaiot Extension
  5. Example: Analyzing Data provided by Talaiot
  6. Other Existing Libraries
  7. Docs
  8. Articles
  9. Contributing
  10. Contributors
  11. Thanks

Setup

Standard Plugin

Kotlin

Using the plugins DSL:

plugins {
  id("com.cdsap.talaiot") version "1.4.2"
}

Using legacy plugin application:

buildscript {
  repositories {
    maven {
      url = uri("https://plugins.gradle.org/m2/")
    }
  }
  dependencies {
    classpath("com.cdsap:talaiot:1.4.2")
  }
}

apply(plugin = "com.cdsap.talaiot")

Groovy

Using the plugins DSL:

plugins {
  id "com.cdsap.talaiot" version "1.4.2"
}

Using legacy plugin application:

buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "com.cdsap:talaiot:1.4.2"
  }
}

apply plugin: "com.cdsap.talaiot"

Individual Plugins

Each plugin is deployed to the Gradle Plugin Portal using thee following convention:

Plugin Id
base com.cdsap.talaiot.plugin.base
elasticsearch com.cdsap.talaiot.plugin.elasticsearch
graph com.cdsap.talaiot.plugin.graph
influxdb com.cdsap.talaiot.plugin.influxdb
pushgateway com.cdsap.talaiot.plugin.pushgateway
rethinkdb com.cdsap.talaiot.plugin.rehinkdb

Kotlin Example Plugin

Using the plugins DSL:

plugins {
  id("com.cdsap.talaiot.plugin.base") version "1.4.2"
}

Using legacy plugin application:

buildscript {
  repositories {
    maven {
      url = uri("https://plugins.gradle.org/m2/")
    }
  }
  dependencies {
    classpath("com.cdsap.talaiot.plugin:base:1.4.2")
  }
}

apply(plugin = "com.cdsap.talaiot.plugin.base")

Groovy

Using the plugins DSL:

plugins {
  id "com.cdsap.talaiot.plugin.base" version "1.4.2"
}

Using legacy plugin application:

buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath ""com.cdsap.talaiot.plugin:base:1.4.2""
  }
}

apply plugin: "com.cdsap.talaiot.plugin.base"

Snapshots

Include the OJO artifactory oss-snapshot local:

maven ( url = uri("http://oss.jfrog.org/artifactory/oss-snapshot-local") )

Standard Plugin

classpath("com.cdsap:talaiot:1.4.3-SNAPSHOT")

Individual Plugin

classpath("com.cdsap.talaiot.plugin:base:1.4.3-SNAPSHOT")

Talaiot Extension

Property Description
logger Mode for logging (Silent,Info)
ignoreWhen Configuration to ignore the execution of Talaiot
generateBuildId Generation of unique identifier for each execution(disabled by default)
publishers Configuration to define where to submit the information of the build
metrics Additional information tracked during the execution of the task
filter Rules to filter the build or the tasks to be reported

Metrics

We can include extra information on the build and task tracked data during the build. This information will be added to the default metrics defined.

talaiot {
    metrics {
        // You can add your own custom Metric objects:
        customMetrics(
            MyCustomMetric(),
            // Including some of the provided metrics, individually.
            HostnameMetric()
        )

        // Or define build or task metrics directly:
        customBuildMetrics(
            "kotlinVersion" to $kotlinVersion,
            "javaVersion" to $javaVersion
        )
        customTaskMetrics(
            "customProperty" to $value
        )
    }
}

Read more about it in the Metrics wiki page.

Filters

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

Property Description
tasks Configuration used to filter which tasks we want to exclude and include in the execution
module Configuration used to filter which modules we want to exclude and include in the execution
threshold Configuration used to define time execution ranges to filter tasks to be reported

For every measurement done, Talaiot can completely skip publishing process. These filters affect all publishers:

Property Description
build.success Configuration used to skip publishing based on build success.
build.requestedTasks Configuration used to skip publishing based on what was the requested task.

Example:

 filter {
     tasks {
         excludes = arrayOf("preDebugBuild", "processDebugResources")
     }
     modules {
         excludes = arrayOf(":app")
     }
     threshold {
         minExecutionTime = 10
     }
     build {
         success = true
         requestedTasks {
             includes = arrayOf(":app:assemble.*")
             excludes = arrayOf(":app:generate.*")
         }
     }
 }

IgnoreWhen

Property Description
envName Name of the Property
envValue Value of the Property

We will use IgnoreWhen when we want to ignore publishing the results of the build. One use case is to ignore it when we are building on CI:

talaiot {
    ignoreWhen {
        envName = "CI"
        envValue = "true"
    }
}

Publishers configuration

The Publisher configuration will change depending on the type of plugin you are using. Standard Plugin provides all the different publisher configurations, for example:

talaiot {
    publishers {
        influxDbPublisher {
            dbName = "tracking"
            url = "http://localhost:8086"
            taskMetricName = "task"
            buildMetricName = "build"
        }

    }
    filter {
        threshold {
            minExecutionTime = 10
        }
    }
}

This configuration would be valid for the InfluxDb Plugin.

InfluxDbPublisher

Talaiot will send to the InfluxDb server defined in the configuration the values collected during the execution

Property Description
dbName Name of the database
url Url of the InfluxDb Server
taskMetricName Name of the metric used for specific task in the execution
buildMetricName Name of the metric used for the overall information of the build in the execution
username username which is used to authorize against the influxDB instance (optional)
password password for the username which is used to authorize against the influxDB (optional)
retentionPolicyConfiguration retention policy which is used for writing points
publishBuildMetrics Publish build metrics of the publisher, true by default
publishTaskMetrics Publish tasks metrics of the publisher, true by default
tags Collection of BuildMetrics used as tags

For complete list of tags check: https://github.com/cdsap/Talaiot/blob/master/library/core/talaiot/src/main/kotlin/com/cdsap/talaiot/metrics/BuildMetrics.kt If you need to include custom metrics as tags, you need to use the type Custom

Included in: com.cdsap.talaiot and com.cdsap.talaiot.plugin.influxdb plugins.

RetentionPolicyConfiguration

Retention Policy (RP) describes how long InfluxDB keeps data, how many copies of the data to store in the cluster, and the time range covered by shard groups. RPs are unique per database and along with the measurement and tag set define a series. Since version 1.0.0 we are including by default RP in all the operations included in the publisher. The RetentionPolicyConfiguration includes:

Property Description
name name of the retentionPolicy(rp). Default rpTalaiot
duration duration of the rp. Default 30d
shardDuration the shardDuration. Default 30m
replicationFactor the replicationFactor of the rp. Default 2
isDefault if the rp is the default rp for the database or not. Default false

Example of custom RP Configuration:

influxDbPublisher {
  dbName = "xxxxxx"
  url = "xxxxxx"
  retentionPolicyConfiguration {
    name = "customRp"
    duration = "4w"
    shardDuration = "30m"
    replicationFactor = 1
    isDefault = true
  }
}

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
gexf Export the task dependency graph in gexf format
dot Export the task dependency graph in png format. See Graphviz

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:

Example:

Included in: com.cdsap.talaiot and com.cdsap.talaiot.plugin.graph plugins.

PushGatewayPublisher

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

Property Description
url Url of the PushGateway Server
taskJobName Name of the job required for the tasks metrics to be exported to Prometheus
buildJobName Name of the job required for the build metrics to be exported to Prometheus
publishBuildMetrics Publish build metrics of the publisher, true by default
publishTaskMetrics Publish tasks metrics of the publisher, true by default

Included in: com.cdsap.talaiot and com.cdsap.talaiot.plugin.pushgateway plugins.

JsonPublisher

Talaiot will Publish the results of the build with a json format .

    publishers {
        jsonPublisher = true

    }

Included in: com.cdsap.talaiot and com.cdsap.talaiot.plugin.base plugins.

TimelinePublisher

Talaiot will create a PNG file with the detailed information in chronological order by task of the execution in the different workers.

    publishers {
        timelinePublisher = true

    }

Included in: com.cdsap.talaiot and com.cdsap.talaiot.plugin.base plugins.

ElasticSearchPublisher

Talaiot will send to the ElasticSearch server defined in the configuration the values collected for tasks and build metrics during the execution in the different workers.

Property Description
url ElasticSearch server
taskIndexName Name for the index used to report tasks metrics
buildIndexName Name for the index used to report build metrics
publishBuildMetrics Publish build metrics of the publisher, true by default
publishTaskMetrics Publish tasks metrics of the publisher, true by default

Example:

    publishers {
        elasticSearchPublisher {
          url = "http://localhost:9200"
          taskIndexName = "task"
          buildIndexName = "build"
        }
    }

Included in: com.cdsap.talaiot and com.cdsap.talaiot.plugin.elasticsearch plugins.

HybridPublisher

This Publisher allows composition over publishers to report tasks and build metrics.

Property Description
taskPublisher Publisher configuration used to publish tasks metrics
buildPublisher Publisher configuration used to publish build metrics

Example:

    publishers {
        hybridPublisher {
            taskPublisher = ElasticSearchPublisherConfiguration().apply {
                url = "http://localhost:9200"
                buildIndexName = "build"
                taskIndexName = "task"
            }

            buildPublisher = InfluxDbPublisherConfiguration().apply {
                dbName = "tracking"
                url = "http://localhost:8086"
                buildMetricName = "build"
                taskMetricName = "task"
            }
        }
    }

In this example we are using InfluxDbPublisher to report build metrics and ElasticSearchPublisher to report task metrics.

Included in: com.cdsap.talaiot plugin.

RethinkDbPublisher

Talaiot will send to the RethinkDb server defined in the configuration the values collected during the execution

Property Description
dbName Name of the database
url Url of the RethinkDb Server
taskTableName Name of the table used to track tasks information
buildTableName Name of the table used to track the build information
username username which is used to authorize against the RethinkDb instance (optional)
password password for the username which is used to authorize against the RethinkDb (optional)
publishBuildMetrics Publish build metrics of the publisher, true by default
publishTaskMetrics Publish tasks metrics of the publisher, true by default

Included in: com.cdsap.talaiot and com.cdsap.talaiot.plugin.rethinkdb plugins.

Custom Publishers

Talaiot allows using custom publishers defined by the requirements of your environment, in case you are using another implementation.

talaiot {
    publishers {
        // You can define one or more custom publishers:
        customPublishers(
            MyCustomPublisher()
        )
    }
}

Read more about it in the Publishers wiki page In you are not using additional plugins we recommend to use com.cdsap.talaiot.plugin.base.

Example: Analyzing Data provided by Talaiot

Docker, InfluxDb and Grafana

To have a quick setup to see the possibilities of Talaiot we are providing a Docker image to setup a Grafana + InfluxDb instances(based on this great repo).

Additionally, the Docker image is creating a default database, a provisioned dashboard and the default datasource for InfluxDb. The source is here:

To run the Docker Image:

docker run -d \
  -p 3003:3003 \
  -p 3004:8083 \
  -p 8086:8086 \
  -p 22022:22 \
  -v /var/lib/influxdb \
  -v /var/lib/grafana \
  cdsap/talaiot:latest

You can access to the local instance of Grafana:

http://localhost:3003 root/root

Populating data

If you access to the provisioned Dashboards included in the Docker Image(http://localhost:3003/d/F9jppxQiz/android-task-tracking?orgId=1 and http://localhost:3003/d/WlpZEBRMz/task-cache-info?orgId=1), you will see an empty dashboard like:

To see Talaiot in action, you need to populate the data. We are providing a script to populate data based in the sample project included in the repository. You can execute the script:

bash scripts/populate.sh

The script will download the repository and with the help of Gradle Profiler(https://github.com/gradle/gradle-profiler) will trigger number of builds defined in the scenario file:

assemble {
  tasks = ["clean"]
}
clean_build {
  versions = ["5.1"]
  tasks = ["assemble"]
  gradle-args = ["--parallel"]
  cleanup-tasks = ["clean"]
  run-using = cli
  warm-ups = 20
}

Once is finished you can check the results on the Grafana Dashboard http://localhost:3003/d/F9jppxQiz/android-task-tracking?orgId=1:

Additionally, we have included a new Dashboard to show how to work with the Caching information of the task execution:

http://localhost:3003/d/WlpZEBRMz/task-cache-info?orgId=1

Other Existing Libraries

Talaiot is not a new idea. There are multiple awesome plugins to use to achieve same results:

Docs

Docs

Articles

Metrics Configuration by Svyatoslav Chatchenko

Understanding Talaiot

Exploring the InfluxDbPublisher in Talaiot

Graphs, Gradle and Talaiot

Talaiot at Scale

Contributing

Talaiot is Open Source and accepts contributions of new Publishers, Metrics and Dashboards that we can include as provisioned ones in the Docker image. With the new Plugin structure you can create your own plugins, feel free to contribute with new plugins or if you want to use your own repo drop us comment to include it in a community plugins.

Contributors

Thanks

Pascal Hartig, Build Time Tracker it was an inspiration to build this plugin.

Bintray release plugin plugin by Novoda

Kohttp Library

Graphviz-java Library

Orchid

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].