<commit_before>/** @file sflow.h
 *  @brief sFlow collector for gmond
 *  @author <NAME> */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <ganglia.h> /* for the libgmond messaging */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>

#include "sflow.h"

static const char *SFLOWMachineTypes[] = {
  "unknown",
  "other",
  "x86",
  "x86_64",
  "ia64",
  "sparc",
  "alpha",
  "powerpc",
  "m68k",
  "mips",
  "arm",
  "hppa",
  "s390",
};
#define SFLOW_MAX_MACHINE_TYPE 12

static const char *SFLOWOSNames[] = {
  "unknown",
  "other",
  "linux",
  "windows",
  "darwin",
  "hpux",
  "aix",
  "dragonfly",
  "freebsd",
  "netbsd",
  "openbsd",
  "osf",
  "solaris",
};
#define SFLOW_MAX_OS_NAME 12

static void
process_sflow_gmetric(Ganglia_host *hostdata, EnumSFLOWGMetric tag, Ganglia_metadata_msg *fmsg, Ganglia_value_msg *vmsg)
{
  /* add the rest of the metadata */
  struct Ganglia_extra_data extra_array[3];
  char *group, *desc, *title;
  Ganglia_metadatadef *gfull = &fmsg->Ganglia_metadata_msg_u.gfull;
  char *mname = SFLOWGMetricTable[tag].mname;
  gfull->metric_id.name = mname;
  gfull->metric.name = SFLOWGMetricTable[tag].mname;
  gfull->metric.units = SFLOWGMetricTable[tag].units;
  gfull->metric.slope = SFLOWGMetricTable[tag].slope;
  gfull->metric.tmax = 60; /* "(secs) poll if it changes faster than this" */
  gfull->metric.dmax = 0; /* "(secs) how long before stale?" */

  /* extra metadata */<commit_msg>[sflow] Update os_name to what is reported by the respective OSes, capitalize the rest<commit_after>/** @file sflow.h
 *  @brief sFlow collector for gmond
 *  @author <NAME> */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <ganglia.h> /* for the libgmond messaging */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>

#include "sflow.h"

static const char *SFLOWMachineTypes[] = {
  "unknown",
  "other",
  "x86",
  "x86_64",
  "ia64",
  "sparc",
  "alpha",
  "powerpc",
  "m68k",
  "mips",
  "arm",
  "hppa",
  "s390",
};
#define SFLOW_MAX_MACHINE_TYPE 12

static const char *SFLOWOSNames[] = {
  "Unknown",
  "Other",
  "Linux",
  "Windows",
  "Darwin",
  "HP-UX",
  "AIX",
  "DragonflyBSD",
  "FreeBSD",
  "NetBSD",
  "OpenBSD",
  "OSF1",
  "SunOS",
};
#define SFLOW_MAX_OS_NAME 12

static void
process_sflow_gmetric(Ganglia_host *hostdata, EnumSFLOWGMetric tag, Ganglia_metadata_msg *fmsg, Ganglia_value_msg *vmsg)
{
  /* add the rest of the metadata */
  struct Ganglia_extra_data extra_array[3];
  char *group, *desc, *title;
  Ganglia_metadatadef *gfull = &fmsg->Ganglia_metadata_msg_u.gfull;
  char *mname = SFLOWGMetricTable[tag].mname;
  gfull->metric_id.name = mname;
  gfull->metric.name = SFLOWGMetricTable[tag].mname;
  gfull->metric.units = SFLOWGMetricTable[tag].units;
  gfull->metric.slope = SFLOWGMetricTable[tag].slope;
  gfull->metric.tmax = 60; /* "(secs) poll if it changes faster than this" */
  gfull->metric.dmax = 0; /* "(secs) how long before stale?" */

  /* extra metadata */
{'fraction_non_alphanumeric': 0.1597084161696488, 'fraction_numerical': 0.014247846255798542, 'mean_word_length': 4.287215411558669, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 29, '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': '451077', 'n_tokens_mistral': 1263, 'n_tokens_neox': 1224, 'n_words': 267}