Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add partial support for collStats, dbStats and dataSize #2322

Merged
merged 20 commits into from
Mar 31, 2023

Conversation

AlekSi
Copy link
Member

@AlekSi AlekSi commented Mar 29, 2023

Description

Partially reverts #1317 / #1359.
Refs #1346.

Readiness checklist

  • I added/updated unit tests.
  • I added/updated integration/compatibility tests.
  • I added/updated comments and checked rendering.
  • I made spot refactorings.
  • I updated user documentation.
  • I ran task all, and it passed.
  • I ensured that PR title is good enough for the changelog.
  • (for maintainers only) I set Reviewers (@FerretDB/core), Assignee, Labels, Project and project's Sprint fields.
  • I marked all done items in this checklist.

@AlekSi AlekSi self-assigned this Mar 29, 2023
@AlekSi AlekSi added the no ci label Mar 29, 2023
@AlekSi AlekSi added this to the v1.0.0 GA milestone Mar 29, 2023
@AlekSi AlekSi added code/feature Some user-visible feature is not implemented yet trust PRs that can access Actions secrets packages PRs that should build packages and removed no ci labels Mar 29, 2023
@AlekSi AlekSi removed trust PRs that can access Actions secrets packages PRs that should build packages labels Mar 29, 2023
@AlekSi AlekSi added the no ci label Mar 30, 2023
@rumyantseva rumyantseva self-assigned this Mar 31, 2023
@rumyantseva rumyantseva added do not merge PRs that should not be merged and removed no ci labels Mar 31, 2023
@codecov
Copy link

codecov bot commented Mar 31, 2023

Codecov Report

Merging #2322 (1766a6e) into main (86cc70a) will decrease coverage by 7.76%.
The diff coverage is 96.15%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2322      +/-   ##
==========================================
- Coverage   71.72%   63.97%   -7.76%     
==========================================
  Files         387      387              
  Lines       18446    18496      +50     
==========================================
- Hits        13230    11832    -1398     
- Misses       4163     5765    +1602     
+ Partials     1053      899     -154     
Impacted Files Coverage Δ
internal/handlers/pg/pgdb/transactions.go 72.72% <40.00%> (+0.35%) ⬆️
internal/handlers/pg/msg_collstats.go 65.90% <100.00%> (+5.38%) ⬆️
internal/handlers/pg/msg_datasize.go 60.37% <100.00%> (ø)
internal/handlers/pg/msg_dbstats.go 67.39% <100.00%> (+0.72%) ⬆️
internal/handlers/pg/msg_serverstatus.go 67.85% <100.00%> (ø)
internal/handlers/pg/pgdb/databases.go 72.34% <100.00%> (ø)
internal/handlers/pg/pgdb/pool.go 69.93% <100.00%> (+12.50%) ⬆️

... and 55 files with indirect coverage changes

Flag Coverage Δ
integration 56.63% <96.15%> (-11.11%) ⬇️
mongodb 4.84% <0.00%> (-0.02%) ⬇️
pg 56.55% <96.15%> (+0.11%) ⬆️
tigris ?
unit 26.63% <8.97%> (-0.09%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@rumyantseva
Copy link
Contributor

I checked how it works with some examples from https://github.com/FerretDB/dance/tree/main/dumps:

weather> db.runCommand( {"dbStats": 1})
{
  db: 'weather',
  collections: 2,
  views: 0,
  objects: 10001,
  avgObjSize: 152.35596440355965,
  dataSize: 1523712,
  indexes: 2,
  indexSize: 622592,
  totalSize: 28286976,
  scaleFactor: 1,
  ok: 1
}
weather> db.runCommand( {"collStats": "data"})
{
  ns: 'weather.data',
  count: 10000,
  size: Long("28254208"),
  storageSize: Long("1515520"),
  totalIndexSize: Long("606208"),
  totalSize: Long("28254208"),
  scaleFactor: 1,
  ok: 1
}
weather> db.runCommand( {"dataSize": "weather.data"})
{
  estimate: false,
  size: 28254208,
  numObjects: 10000,
  millis: 53,
  ok: 1
}

@rumyantseva rumyantseva marked this pull request as ready for review March 31, 2023 13:51
@rumyantseva rumyantseva requested a review from a team as a code owner March 31, 2023 13:51
@rumyantseva rumyantseva changed the title Add partial schema stats Add partial support for collStats, dbStats and dataSize Mar 31, 2023
@rumyantseva
Copy link
Contributor

@AlekSi please review and remove "do not merge" label

@rumyantseva rumyantseva enabled auto-merge (squash) March 31, 2023 14:04
rumyantseva
rumyantseva previously approved these changes Mar 31, 2023
Copy link
Contributor

@rumyantseva rumyantseva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

w84thesun
w84thesun previously approved these changes Mar 31, 2023
Copy link
Contributor

@w84thesun w84thesun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@rumyantseva rumyantseva dismissed stale reviews from w84thesun and themself via 1766a6e March 31, 2023 14:37
@rumyantseva
Copy link
Contributor

Fixed scale!

@AlekSi AlekSi removed the do not merge PRs that should not be merged label Mar 31, 2023
Copy link
Member Author

@AlekSi AlekSi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, can't approve "my own" PR

@AlekSi AlekSi removed their assignment Mar 31, 2023
@rumyantseva rumyantseva merged commit cc6c473 into FerretDB:main Mar 31, 2023
efirs added a commit to tigrisdata-archive/ferretdb that referenced this pull request Apr 11, 2023
v1.0.0
https://github.com/FerretDB/FerretDB/releases/tag/v1.0.0
2023-04-03

We are delighted to announce the release of FerretDB 1.0 GA!

* Support `$sum` accumulator of `$group` aggregation by @chilagrow in FerretDB#2292
* Implement `createIndexes` command by @rumyantseva in FerretDB#2244
* Add basic `getMore` command by @AlekSi in FerretDB#2309
* Implement `dropIndexes` command by @chilagrow in FerretDB#2313
* Implement `$limit` aggregation pipeline stage by @noisersup in FerretDB#2270
* Add partial support for `collStats`, `dbStats` and `dataSize` by @AlekSi in FerretDB#2322
* Implement `$skip` aggregation pipeline stage by @w84thesun in FerretDB#2310
* Implement `$unwind` aggregation pipeline stage by @noisersup in FerretDB#2294
* Support `count` and `storageStats` fields in `$collStats` aggregation pipeline stage by @rumyantseva in FerretDB#2338

* Fix dot notation negative index errors by @w84thesun in FerretDB#2246
* Apply `skip` before `limit` by @AlekSi in FerretDB#2351

* Update supported command for `$sum` aggregation operator by @chilagrow in FerretDB#2318
* Add supported shells and GUIs images by @AlekSi in FerretDB#2323
* Publish FerretDB v0.9.4 blog post by @Fashander in FerretDB#2268
* Use dashes instead of underscores or spaces by @AlekSi in FerretDB#2329
* Update documentation sidebar by @Fashander in FerretDB#2347
* Update FerretDB descriptions by @AlekSi in FerretDB#2281
* Improve flags documentation by @AlekSi in FerretDB#2331
* Describe supported fields for `$collStats` aggregation stage by @rumyantseva in FerretDB#2352

* Use iterators for `sort`, `limit`, `skip`, and `projection` by @AlekSi in FerretDB#2254
* Bump dependencies by @AlekSi in FerretDB#2307
* Improve resource tracking by @AlekSi in FerretDB#2319
* Add tests for `find`'s and `count`'s `skip` argument by @w84thesun in FerretDB#2325
* Close iterator properly by @AlekSi in FerretDB#2333
* Improve large numbers initialization in test data by @noisersup in FerretDB#2324
* Ignore `unique` index option for now by @AlekSi in FerretDB#2350

All closed issues and pull requests: https://github.com/FerretDB/FerretDB/milestone/39?closed=1
All commits: FerretDB/FerretDB@v0.9.4...v1.0.0
efirs added a commit to tigrisdata-archive/ferretdb that referenced this pull request Apr 11, 2023
v1.0.0
https://github.com/FerretDB/FerretDB/releases/tag/v1.0.0
2023-04-03

We are delighted to announce the release of FerretDB 1.0 GA!

* Support `$sum` accumulator of `$group` aggregation by @chilagrow in FerretDB#2292
* Implement `createIndexes` command by @rumyantseva in FerretDB#2244
* Add basic `getMore` command by @AlekSi in FerretDB#2309
* Implement `dropIndexes` command by @chilagrow in FerretDB#2313
* Implement `$limit` aggregation pipeline stage by @noisersup in FerretDB#2270
* Add partial support for `collStats`, `dbStats` and `dataSize` by @AlekSi in FerretDB#2322
* Implement `$skip` aggregation pipeline stage by @w84thesun in FerretDB#2310
* Implement `$unwind` aggregation pipeline stage by @noisersup in FerretDB#2294
* Support `count` and `storageStats` fields in `$collStats` aggregation pipeline stage by @rumyantseva in FerretDB#2338

* Fix dot notation negative index errors by @w84thesun in FerretDB#2246
* Apply `skip` before `limit` by @AlekSi in FerretDB#2351

* Update supported command for `$sum` aggregation operator by @chilagrow in FerretDB#2318
* Add supported shells and GUIs images by @AlekSi in FerretDB#2323
* Publish FerretDB v0.9.4 blog post by @Fashander in FerretDB#2268
* Use dashes instead of underscores or spaces by @AlekSi in FerretDB#2329
* Update documentation sidebar by @Fashander in FerretDB#2347
* Update FerretDB descriptions by @AlekSi in FerretDB#2281
* Improve flags documentation by @AlekSi in FerretDB#2331
* Describe supported fields for `$collStats` aggregation stage by @rumyantseva in FerretDB#2352

* Use iterators for `sort`, `limit`, `skip`, and `projection` by @AlekSi in FerretDB#2254
* Bump dependencies by @AlekSi in FerretDB#2307
* Improve resource tracking by @AlekSi in FerretDB#2319
* Add tests for `find`'s and `count`'s `skip` argument by @w84thesun in FerretDB#2325
* Close iterator properly by @AlekSi in FerretDB#2333
* Improve large numbers initialization in test data by @noisersup in FerretDB#2324
* Ignore `unique` index option for now by @AlekSi in FerretDB#2350

All closed issues and pull requests: https://github.com/FerretDB/FerretDB/milestone/39?closed=1
All commits: FerretDB/FerretDB@v0.9.4...v1.0.0
@AlekSi AlekSi deleted the schema-stats branch August 30, 2023 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code/feature Some user-visible feature is not implemented yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants