[Summary, full note in Shaarli]
whisper-dump.py : script Python 2 qui affiche le contenu brut d'un fichier whisper (.wsp) de Graphite. Usage : whisper-dump.py path
- Nécessite le module whisper ; ignore SIGPIPE pour pouvoir piper la sortie (head, less...).
- Ouvre le fichier en lecture seule avec mmap.
- read_header : struct.unpack(whisper.metadataFormat) donne aggregationType, maxRetention, xFilesFactor, archiveCount ; puis, pour chaque archive, whisper.archiveInfoFormat donne offset, secondsPerPoint, points (retention = secondsPerPoint * points, size = points * whisper.pointSize).
- Affiche les métadonnées (aggregation method, max retention, xFilesFactor) et l'en-tête de chaque archive.
- dump_archives : pour chaque archive, lit chaque point avec whisper.pointFormat et affiche "index: timestamp, valeur".
- Erreur si le fichier n'existe pas ; CorruptWhisperFile si l'en-tête ne se lit pas.