<commit_before>package main

import (
	"errors"
	"fmt"
	"io/ioutil"
	"net/http"
	"os"
	"strconv"
	"strings"

	"github.com/codegangsta/cli"
	mp "github.com/mackerelio/go-mackerel-plugin"
)

// metric value structure
var graphdef map[string](mp.Graphs) = map[string](mp.Graphs){
	"php-apc.purges": mp.Graphs{
		Label: "APC purge count",
		Unit:  "integer",
		Metrics: [](mp.Metrics){
			mp.Metrics{Name: "cache_full_count", Label: "File Cache", Diff: true, Stacked: false},
			mp.Metrics{Name: "user_cache_full_count", Label: "User Cache", Diff: true, Stacked: false},
		},
	},
	"php-apc.stats": mp.Graphs{
		Label: "APC file cache statistics",
		Unit:  "integer",
		Metrics: [](mp.Metrics){
			mp.Metrics{Name: "cache_hits", Label: "Hits", Diff: true, Stacked: false},
			mp.Metrics{Name: "cache_misses", Label: "Misses", Diff: true, Stacked: false},
		},
	},
	"php-apc.cache_size": mp.Graphs{
		Label: "APC cache size",
		Unit:  "float",
		Metrics: [](mp.Metrics){
			mp.Metrics{Name: "Code Cache", Label: "cached_files_size", Diff: false, Stacked: true},
			mp.Metrics{Name: "User Items Cache", Label: "user_cache_vars_size", Diff: false, Stacked: true},
			mp.Metrics{Name: "Limit", Label: "total_memory", Diff: false, Stacked: false},
		},
	},
	"php-apc.user_stats": mp.Graphs{
		Label: "APC user cache statistics",
		Unit:  "integer",
		Metrics: [](mp.Metrics){
			mp.Metrics{Name: "user_cache_hits", Label: "Hits", Diff: true, Stacked: false},
			mp.Metrics{Name: "user_cache_misses", Label: "Misses", Diff: true, Stacked: false},
		},
	},
}

// for fetching metrics
type PhpApcPlugin struct {<commit_msg>Fix label and name.<commit_after>package main

import (
	"errors"
	"fmt"
	"io/ioutil"
	"net/http"
	"os"
	"strconv"
	"strings"

	"github.com/codegangsta/cli"
	mp "github.com/mackerelio/go-mackerel-plugin"
)

// metric value structure
var graphdef map[string](mp.Graphs) = map[string](mp.Graphs){
	"php-apc.purges": mp.Graphs{
		Label: "PHP APC purge count",
		Unit:  "integer",
		Metrics: [](mp.Metrics){
			mp.Metrics{Name: "cache_full_count", Label: "File Cache", Diff: true, Stacked: false},
			mp.Metrics{Name: "user_cache_full_count", Label: "User Cache", Diff: true, Stacked: false},
		},
	},
	"php-apc.stats": mp.Graphs{
		Label: "PHP APC file cache statistics",
		Unit:  "integer",
		Metrics: [](mp.Metrics){
			mp.Metrics{Name: "cache_hits", Label: "Hits", Diff: true, Stacked: false},
			mp.Metrics{Name: "cache_misses", Label: "Misses", Diff: true, Stacked: false},
		},
	},
	"php-apc.cache_size": mp.Graphs{
		Label: "PHP APC cache size",
		Unit:  "float",
		Metrics: [](mp.Metrics){
			mp.Metrics{Name: "cached_files_size", Label: "File Cache", Diff: false, Stacked: true},
			mp.Metrics{Name: "user_cache_vars_size", Label: "User Cache", Diff: false, Stacked: true},
			mp.Metrics{Name: "total_memory", Label: "Total", Diff: false, Stacked: false},
		},
	},
	"php-apc.user_stats": mp.Graphs{
		Label: "PHP APC user cache statistics",
		Unit:  "integer",
		Metrics: [](mp.Metrics){
			mp.Metrics{Name: "user_cache_hits", Label: "Hits", Diff: true, Stacked: false},
			mp.Metrics{Name: "user_cache_misses", Label: "Misses", Diff: true, Stacked: false},
		},
	},
}

// for fetching metrics
type PhpApcPlugin struct {
{'fraction_non_alphanumeric': 0.17954264524103833, 'fraction_numerical': 0.0, 'mean_word_length': 4.619791666666667, 'pattern_counts': {'":': 8, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6120152', 'n_tokens_mistral': 1308, 'n_tokens_neox': 1230, 'n_words': 296}