Giter Club home page Giter Club logo

cloud-stats-plugin's Introduction

Cloud Statistics Plugin

The plugin collects activities of other plugins and visualizes them as well as provides them to other plugins in form of an API.

Note that a provisioning plugin needs to explicitly integrate against this plugin in order to capture its statistics.

The statistics are presented on Manage Jenkins > Cloud Statistics.

Essentials

  • The plugin tracks the N most recent provisioning activities. One such activity covers the whole lifecycle from provisioning to agent deletion.

  • The activities have 4 hard-coded phases: provisioning, launching, operating and completed. Operation starts with first successful launch and ends with agent deletion (it is the only productive phase). The activity is completed once the agent is gone and the activity is effectively a history.

  • Each phase execution tracks start time and a list of attachments. The attachment is extensible and can be a mere piece of html, hyperlink or a model object with URL subspace. This is to attach and present any kind of information: logs, exceptions, etc.

  • Each attachment has a state: ok, warn or fail. The worst of all attached states is propagated to the phase execution and activity level. (If agent fails to launch, and exception will be attached explaining why the launch phase and thus the whole activity has failed).

Integrating cloud plugin with cloud-stats-plugin

In order for cloud-stats plugin to recognize provisioning activity to track, plugins are expected to do the following:

  • Make PlannedNode, Computer and Node implement TrackedItem. The interface provides a single method to connect all those using a dedicated Id instance. The instance holds some necessary data to connect it back to the cloud/template responsible for provisioning and works as a unique fingerprint identifying a single provisioning activity. Therefore, PlannedNode, Computer and Node are expected to provide the same instance of the Id. Note that there is a convenient abstract class TrackedPlannedNode that creates the Id so a plugin merely needs to pass it around.

  • In case there is a way to provision agents that does not go through Jenkins core (NodeProvisioner), plugins are expected to notify cloud-stats about such activity. This often happens when agents are provisioned manually in the Jenkins UI. Provided the agent gets attached to Jenkins, cloud-stats will track it just fine from launching phase on without any explicit notifications from a provisioning plugin.

  • Optionally, a plugin can attach any kind of information to any phase. cloud-stats is generally able to attach an exception in case of a failed launch or provisioning (with the exception mentioned above). Though a plugin may wants to attach logs, outputs, link to external services, etc.

cloud-stats-plugin's People

Contributors

olivergondza avatar darxriggs avatar pjanouse avatar res0nance avatar daniel-beck-bot avatar vvanholl avatar

Watchers

James Cloos avatar  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.