Giter VIP home page Giter VIP logo

gradle-cache-server's Introduction

gradle-cache-server

Golang simple gradle cache server. Used to increase gradle build speed

Configure server

Create sample directory structure

. /opt
├── data
│   ├── cache
│   ├── gradle-cache-server
│   └── config.json

Where

object type comment
cache directory directory for cache
gradle-cache-server file server executable
config.json file configuration file

Server settings

Server settings stored in file config.json

{
  "path": "/opt/data/cache",
  "port": 32555,
  "scan": "1h",
  "alive": "7d"
}

Where

property type comment
path string cache directory
port int server port
scan string cache clear: scan interval
alive string cache clear: max time old file alive before delete

Scan and alive formats

Format is {number}{literal}, where

literal comment
s second
m minute
h hour
d day
w week

Start server

cd /opt/data
./gradle-cache-server

Note: server reads file config.json from current workdir

Configure gradle project

Configure gradle settings file

In this sample gradle cache server started at the same computer, where gradle builds. But it can be started on a remote server. Add next lines to settings.gradle

buildCache {
    remote(HttpBuildCache) {
        url = 'http://localhost:32555/'
        push = true
    }
}

For full list of configuration properties see documentation.

Note: server supports a cache subpath, like http://localhost:32555/team1/

Start build with cache

From command line

gradle build --build-cache

Or from gradle.properties file

org.gradle.caching=true

Monitoring

Prometheus metrics available at /metrics endpoint on the same port. Metrics

name type comment
cache_get counter Total number of requested items
cache_put counter Total number of saved items
cache_del counter Total number of deleted items

Metrics attributes (labels)

name comment
code http status code (200 or 404)
path0 part#0 of url
path1 part#1 of url

Part examples

Request URL path0 path1
/9af937214740e6369e0d9c47dbea521d empty string empty string
/service/9af937214740e6369e0d9c47dbea521d service empty string
/team/service/9af937214740e6369e0d9c47dbea521d team service
/space/team/service/9af937214740e6369e0d9c47dbea521d space team

gradle-cache-server's People

Contributors

laminy avatar

Stargazers

Cypherpunk Samurai avatar Andrey Kochetkov avatar

Watchers

 avatar Andrey Kochetkov avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.