4337 links
  • Arnaud's links
  • Home
  • Login
  • RSS Feed
  • ATOM Feed
  • Tag cloud
  • Picture wall
  • Daily
    Type 1 or more characters for results.
    Links per page: 20 50 100
    page 1 / 1
    4 results tagged whisper x
    • Note: Bilan whisper et aggregationMethod

      cd /opt/graphite/storage/whisper
      find . -name "*.wsp" | xargs -I {} sh -c "echo -n '{} ' ; whisper-info.py {}|grep aggre|cut -d' ' -f2" > aggreg.dump

      cut -d' ' -f2 aggreg.dump|sort|uniq -c

      82024 average
      2784 max
      1378 min
      8732 sum

      grep -v stats aggreg.dump |cut -d' ' -f2|sort|uniq -c

      59682 average

      Donc oui, tous les whispers collectd sont en average.

      February 3, 2016 at 2:49:31 PM GMT+1 - permalink - archive.org - https://links.infomee.fr/?CAc6mw
      graphite whisper
    • thumbnail
      lomik/go-carbon - Go

      Golang implementation of Graphite/Carbon server with classic architecture: Agent -> Cache -> Persister

      used by Doo 1M metric/sec (12 CPU)

      January 18, 2016 at 2:57:11 PM GMT+1 - permalink - archive.org - https://github.com/lomik/go-carbon
      carbon go graphite whisper
    • whisper calculator

      !/usr/bin/env python

      -- coding: utf-8 --

      def archive_to_bytes(archive):
      def to_seconds(s):
      SECONDS_IN_A = {
      's': 1,
      'm': 1 60,
      'h': 1
      60 60,
      'd': 1
      60 60 24,
      'y': 1 60 60 24 365,
      }

          return int(s[:-1]) * SECONDS_IN_A[s[-1]]
      
      archive = [map(to_seconds, point.split(':'))
                 for point in args.archive.split(',')]
      
      SIZE_METADATA = 2 * 4 + 4 + 4  # 16 [!2LfL]
      SIZE_ARCHIVE_INFO = 3 * 4  # 12 [!3L]+
      SIZE_POINT = 4 + 8  # 12 [!Ld]+
      
      size = 0
      for resolution, retention in archive:
          size += SIZE_ARCHIVE_INFO + SIZE_POINT * retention/resolution
      
      if size:
          size += SIZE_METADATA
      
      return size

      if name == 'main':
      import argparse

      parser = argparse.ArgumentParser(
          description="Calculates the size of the whisper storage for the given \
                  archive (in resolution:retention format, e.g. 1m:24h,5m:3m)"
      )
      parser.add_argument(
          'archive',
          help="Archive in storage-schemas.conf format (resolution:retention)"
      )
      
      args = parser.parse_args()
      
      print "{} >> {} bytes".format(args.archive, archive_to_bytes(args.archive))
      July 24, 2014 at 10:14:44 AM GMT+2 - permalink - archive.org - https://gist.github.com/jjmaestro/5774063#file-whisper-calculator-py
      calc graphite whisper
    • whisper dump

      !/usr/bin/env python

      import os
      import mmap
      import struct
      import signal
      import optparse

      try:
      import whisper
      except ImportError:
      raise SystemExit('[ERROR] Please make sure whisper is installed properly')

      Ignore SIGPIPE

      signal.signal(signal.SIGPIPE, signal.SIG_DFL)

      option_parser = optparse.OptionParser(usage='''%prog path''')
      (options, args) = option_parser.parse_args()

      if len(args) != 1:
      option_parser.error("require one input file name")
      else:
      path = args[0]

      def mmap_file(filename):
      fd = os.open(filename, os.O_RDONLY)
      map = mmap.mmap(fd, os.fstat(fd).st_size, prot=mmap.PROT_READ)
      os.close(fd)
      return map

      def read_header(map):
      try:
      (aggregationType,maxRetention,xFilesFactor,archiveCount) = struct.unpack(whisper.metadataFormat,map[:whisper.metadataSize])
      except:
      raise CorruptWhisperFile("Unable to unpack header")

      archives = []
      archiveOffset = whisper.metadataSize

      for i in xrange(archiveCount):
      try:
      (offset, secondsPerPoint, points) = struct.unpack(whisper.archiveInfoFormat, map[archiveOffset:archiveOffset+whisper.archiveInfoSize])
      except:
      raise CorruptWhisperFile("Unable to read archive %d metadata" % i)

      archiveInfo = {
        'offset' : offset,
        'secondsPerPoint' : secondsPerPoint,
        'points' : points,
        'retention' : secondsPerPoint * points,
        'size' : points * whisper.pointSize,
      }
      archives.append(archiveInfo)
      archiveOffset += whisper.archiveInfoSize

      header = {
      'aggregationMethod' : whisper.aggregationTypeToMethod.get(aggregationType, 'average'),
      'maxRetention' : maxRetention,
      'xFilesFactor' : xFilesFactor,
      'archives' : archives,
      }
      return header

      def dump_header(header):
      print 'Meta data:'
      print ' aggregation method: %s' % header['aggregationMethod']
      print ' max retention: %d' % header['maxRetention']
      print ' xFilesFactor: %g' % header['xFilesFactor']
      print
      dump_archive_headers(header['archives'])

      def dump_archive_headers(archives):
      for i,archive in enumerate(archives):
      print 'Archive %d info:' % i
      print ' offset: %d' % archive['offset']
      print ' seconds per point: %d' % archive['secondsPerPoint']
      print ' points: %d' % archive['points']
      print ' retention: %d' % archive['retention']
      print ' size: %d' % archive['size']
      print

      def dump_archives(archives):
      for i,archive in enumerate(archives):
      print 'Archive %d data:' %i
      offset = archive['offset']
      for point in xrange(archive['points']):
      (timestamp, value) = struct.unpack(whisper.pointFormat, map[offset:offset+whisper.pointSize])
      print '%d: %d, %10.35g' % (point, timestamp, value)
      offset += whisper.pointSize
      print

      if not os.path.exists(path):
      raise SystemExit('[ERROR] File "%s" does not exist!' % path)

      map = mmap_file(path)
      header = read_header(map)
      dump_header(header)
      dump_archives(header['archives'])

      July 24, 2014 at 10:13:52 AM GMT+2 - permalink - archive.org - http://bazaar.launchpad.net/~amos-shapira/graphite/whisper-dump/revision/733#whisper/bin/whisper-dump.py
      dump graphite whisper
    Links per page: 20 50 100
    page 1 / 1
    Shaarli - The personal, minimalist, super-fast, database free, bookmarking service by the Shaarli community - Help/documentation