ccacheparser

package module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2018 License: MIT Imports: 5 Imported by: 1

README

ccacheparser
============

A simple utility to convert `ccache`_ statistics to a JSON object.

====== ======
Branch Status
====== ======
master .. image:: https://travis-ci.org/virtualtam/ccacheparser.svg?branch=master
          :target: https://travis-ci.org/virtualtam/ccacheparser
          :alt: Travis build status
====== ======

Building
--------

::

   # get the sources
   $ git clone https://github.com/virtualtam/ccacheparser.git

   # go >= 1.11: enable module support
   $ export GO111MODULE=on

   # build ccacheparser
   $ make build


Usage
-----

::

   $ ccache -s | ccacheparser | jq

   {
     "cache_directory": "/home/virtualtam/.ccache",
     "primary_config": "/home/virtualtam/.ccache/ccache.conf",
     "secondary_config_readonly": "/etc/ccache.conf",
     "stats_time": "2018-09-24T21:19:07.997866938+02:00",
     "stats_zero_time": "2018-09-23T01:18:52+02:00",
     "cache_hit_direct": 124,
     "cache_hit_preprocessed": 8,
     "cache_miss": 297,
     "cache_hit_rate": 30.77,
     "called_for_link": 39,
     "called_for_preprocessing": 263,
     "unsupported_code_directive": 5,
     "no_input_file": 83,
     "cleanups_performed": 0,
     "files_in_cache": 926,
     "cache_size": "17.5 MB",
     "cache_size_bytes": 17500000,
     "max_cache_size": "15.0 GB",
     "max_cache_size_bytes": 15000000000
   }


.. _ccache: https://github.com/ccache/ccache

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Statistics

type Statistics struct {
	CacheDirectory           string            `json:"cache_directory"`
	PrimaryConfig            string            `json:"primary_config"`
	SecondaryConfigReadonly  string            `json:"secondary_config_readonly"`
	StatsTime                time.Time         `json:"stats_time"`
	StatsZeroTime            time.Time         `json:"stats_zero_time"`
	CacheHitDirect           int               `json:"cache_hit_direct"`
	CacheHitPreprocessed     int               `json:"cache_hit_preprocessed"`
	CacheMiss                int               `json:"cache_miss"`
	CacheHitRate             float64           `json:"cache_hit_rate"`
	CacheHitRatio            float64           `json:"cache_hit_ratio"`
	CalledForLink            int               `json:"called_for_link"`
	CalledForPreprocessing   int               `json:"called_for_preprocessing"`
	UnsupportedCodeDirective int               `json:"unsupported_code_directive"`
	NoInputFile              int               `json:"no_input_file"`
	CleanupsPerformed        int               `json:"cleanups_performed"`
	FilesInCache             int               `json:"files_in_cache"`
	CacheSize                string            `json:"cache_size"`
	CacheSizeBytes           units.MetricBytes `json:"cache_size_bytes"`
	MaxCacheSize             string            `json:"max_cache_size"`
	MaxCacheSizeBytes        units.MetricBytes `json:"max_cache_size_bytes"`
}

Statistics represents information about ccache configuration and usage.

func (*Statistics) Parse

func (s *Statistics) Parse(text string)

Parse reads ccache statistics as formatted by the `ccache -s` command.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL