Giter VIP home page Giter VIP logo

Comments (1)

mdevan avatar mdevan commented on June 12, 2024 1

Thanks for your input!

Right now, the situation is that you need to refer to pg_settings inorder to interpret the "settings" field of the JSON output. Additionally, the pg_settings has to be of the same major version of Postgres as the server you ran pgmetrics on. This is because (1) values have unintuitive units (2) these units differ across versions for the same setting. To illustrate, if the settings says "max_wal_size" is "1", the actual value is either 16777216 bytes (if pg 9.5, 9.6) or 1048576 bytes (if pg 10).

For the settings value to be actually useful -- as in be able to be directly used for processing by a script without needing to consult pg_settings -- would require that the units also be considered while representing the value as a number. Byte-dimension values with non-byte units ("8kB", "MB", "kB" in pg10) should be normalized to bytes and time-dimension values ("min", "ms" in pg10) to seconds.

So, if we have a query or two (and/or Go code) that can do this, then we can add a new field (because we don't want to break the existing JSON schema) of float type (because JSON has only a "number" type, which is 64-bit float) at the same level as "setting", like this:

"settings": {
	//...
	"max_wal_size": {
		"setting": "1",
		"actual": 16777216
	},
	//...
}

from pgmetrics.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.