<commit_before>// Package mcrouter gathers Redis related data from a host.
package mcrouter

import (
	"bufio"
	"bytes"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"os"
	"os/exec"
	"strconv"
	"strings"
)

type Base struct {
	HostAndPort string
	ConfigFile  string
}

func (mcr *Base) Stats() (map[string]interface{}, error) {
	stats, err := mcr.StatsFromNetcat()
	if err != nil {
		return nil, err
	}

	statsFromFile, err := mcr.StatsFromFile()
	if err != nil {
		return nil, err
	}

	for key, value := range statsFromFile {
		trimmedKey := strings.Replace(key, "libmcrouter.mcrouter.5000.", "", -1)
		stats[trimmedKey] = value
	}

	hostname, err := os.Hostname()
	if err == nil {
		stats["hostname"] = hostname
	}

	return stats, nil
}
<commit_msg>remove hostname on mcrouter<commit_after>// Package mcrouter gathers Redis related data from a host.
package mcrouter

import (
	"bufio"
	"bytes"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"os/exec"
	"strconv"
	"strings"
)

type Base struct {
	HostAndPort string
	ConfigFile  string
}

func (mcr *Base) Stats() (map[string]interface{}, error) {
	stats, err := mcr.StatsFromNetcat()
	if err != nil {
		return nil, err
	}

	statsFromFile, err := mcr.StatsFromFile()
	if err != nil {
		return nil, err
	}

	for key, value := range statsFromFile {
		trimmedKey := strings.Replace(key, "libmcrouter.mcrouter.5000.", "", -1)
		stats[trimmedKey] = value
	}

	return stats, nil
}

{'fraction_non_alphanumeric': 0.1397163120567376, 'fraction_numerical': 0.0070921985815602835, 'mean_word_length': 3.8321917808219177, 'pattern_counts': {'":': 0, '<': 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': '5291136', 'n_tokens_mistral': 558, 'n_tokens_neox': 539, 'n_words': 144}