util

package
v0.0.0-...-4467ac1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2015 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Internal package that provides utility functions for the tools that process the mongodb profiler collection or that capture mongodb network traffic.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSlowQueryLogHeader

func GetSlowQueryLogHeader(input OpInfo) (output string)

This formats a slow query log entry header, filling in performance information from the OpInfo map

func RecurseArray

func RecurseArray(input []interface{}) (output string)

This walks an array and generates a string representation of its contents. It recurses down substructures as needed, provided they're one of a [string]interface{} map (i.e. a json doc) or another array. There are no depth controls, so a sufficiently deep structure could blow the stack

Types

type OpInfo

type OpInfo map[string]string

This is used to save data points that will be used when generating the slow query log entry header. Examples include response time, lock time, user, host, etc.

func RecurseJsonMap

func RecurseJsonMap(json map[string]interface{}) (output string, query string, info OpInfo)

This does the same as the previous function, but with a json document, and populating info on the way. The same stack disclaimer applies here. This is the point where data types are converted to their appropriate representation. Anything above this call will deal with strings only.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL