Comments (6)
Thanks, good suggestions!
How about a couple of options like:
--match-table=PATTERN include only tables whose name matches PATTERN
--match-schema=PATTERN include objects only from schema that match PATTERN
where PATTERN is a POSIX regular expression, and if it starts with ! then the meaning is inverted (exclude tables/schema). Both options may be used at the same time and works like "AND".
Do you think this will fit your use cases?
from pgmetrics.
The regex stuff is more than I asked for, but sure that'll work for most table and schema filtering, but what about the case where I don't want table info? Now I have to write a regex pattern that will not return anything as opposed to a parameter that just says --no-tables and/or --no-schemas. How about both? Also, if I use regex filtering it makes it more difficult than to specify 2 schemas directly with the --schema parameter which expects a comma-delimited list of schemas.
It seems to me regex stuff is more applicable to tables where you could have thousands, but not to schemas where you might have a few. So I would recommend the regex for tables but a comma-delimited list for schemas.
Also, don't forget about the system info being placed before table output.
2 ways to specify schemas:
--schemas schema1, schema2
--schema schema1 --schema schema2
from pgmetrics.
OK, let's list down the items.
- filter tables: use an option to include/exclude tables based on regexps
- filter schema: use a repeatable option to only include objects from the specified schema
These two sound good, let's go with it.
I guess the third item is what objects we should collect from a single database. Right now, pgmetrics gets information about:
- tables
- indexes
- sequences
- user function timings
- extensions (this one is not schema-specific)
- disabled triggers
So if we want to collect only some of these types, then there should be an option that specifies that, I think. Like "--collect=tables,indexes" would collect only tables and indexes, or "--collect=all" would collect everything. Thoughts?
And the fourth one is about the report cosmetics, which we'll handle separately in another issue -- it is not related to data collection after all. (And I agree, it makes sense to put it just below the "PostgreSQL Cluster:" section. It gives more context for the rest of the report.)
from pgmetrics.
b38c9ec includes these schema and table selection options:
Collection options:
-c, --schema=REGEXP collect only from schema(s) matching POSIX regexp
-C, --exclude-schema=REGEXP do NOT collect from schema(s) matching POSIX regexp
-a, --table=REGEXP collect only from table(s) matching POSIX regexp
-A, --exclude-table=REGEXP do NOT collect from table(s) matching POSIX regexp
These are similar to pg_dump
's options, except that it's based on regexp.
from pgmetrics.
13393c2 shows the system information earlier on in the output.
from pgmetrics.
51462e3 includes option to omit the collection of one or more of: tables, indexes, sequences, functions, extensions and triggers.
--omit=WHAT do NOT collect the items specified as a comma-separated
list of: "tables", "indexes", "sequences",
"functions", "extensions", "triggers"
That addresses all the points in this issue, I think. Feel free to reopen this/open another issue if it doesn't.
from pgmetrics.
Related Issues (20)
- use iso date format everywhere in report
- Log parsing clarification HOT 4
- How to read some values reported by pgmetrics (e.g. shared_buffers, max_wal_size) HOT 6
- Postgres 13: wal_keep_segments displays no value HOT 2
- What determines the sort order for list of table details in pgmetrics output? HOT 2
- Incorrect min_wal_size displayed for PG ver >= 10 HOT 2
- Improve heuristic to check if PG is local HOT 4
- Slow bloat query HOT 4
- AWS RDS, Aurora cloudwatch collection error HOT 3
- pg_stat_archiver query failed: sql: Scan error on column index 6, name "date_part": converting NULL to int64 is unsupported HOT 2
- Omitting retrieval of index definition HOT 1
- Please, add building instructions HOT 2
- Support Citus 11 HOT 2
- Crashes PSQL when table has high Partition Count HOT 2
- Break up the Postgres shared memory is not available in pgmetrics/pgDash currently.
- how to collect system info with pgmetrics HOT 1
- [Feature] Support connect by Keyword/Value Connection Strings
- support PG16 HOT 2
- PgMetrics not working for AWS Aurora Instances HOT 1
- PGBOUNCER 1.21 breaking change.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pgmetrics.