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

show more statistic information in status subcommand #2977

Merged
merged 12 commits into from
Nov 17, 2022

Conversation

Hexilee
Copy link
Contributor

@Hexilee Hexilee commented Nov 14, 2022

Close #2957

With this PR, we can find the FsStat information in the status subcommand:

./juicefs status redis://localhost
2022/11/17 12:07:01.464620 juicefs[328399] <INFO>: Meta address: redis://localhost [interface.go:414]
2022/11/17 12:07:01.466300 juicefs[328399] <INFO>: Ping redis: 80.055µs [redis.go:2988]
{
  "Setting": {
    "Name": "myjfs",
    "UUID": "4bdf1c96-c1cd-4450-84af-d16162af60c0",
    "Storage": "minio",
    "Bucket": "http://127.0.0.1:9000/jfs",
    "AccessKey": "minioadmin",
    "SecretKey": "removed",
    "BlockSize": 4096,
    "Compression": "none",
    "EncryptAlgo": "aes256gcm-rsa",
    "KeyEncrypted": true,
    "MetaVersion": 1
  },
  "Sessions": [
    {
      "Sid": 23,
      "Expire": "2022-11-17T12:07:53+08:00",
      "Version": "1.1.0-dev+2022-11-16.efeccc5d",
      "HostName": "Arch",
      "MountPoint": "/mnt/jfs",
      "ProcessID": 279925
    }
  ],
  "Statistic": {
    "UsedSpace": 39661568,
    "AvailableSpace": 1125899867181056,
    "UsedInodes": 607,
    "AvailableInodes": 10485760
  }
}

Moreover, we add a flag --more or -m to show more information that may slowly be scanned.

2022/11/17 12:07:06.179401 juicefs[328426] <INFO>: Meta address: redis://localhost [interface.go:414]
2022/11/17 12:07:06.180813 juicefs[328426] <WARNING>: AOF is not enabled, you may lose data if Redis is not shutdown properly. [info.go:83]
2022/11/17 12:07:06.181005 juicefs[328426] <INFO>: Ping redis: 140.293µs [redis.go:2988]
Delayed Slices count: 582377                                                          ⠴
Delayed Slices bytes: 256.09 GiB (274969369656 Bytes)                                 ⠴
 Delayed Files count: 0                                                               ⠴
 Delayed Files bytes: 0.00 b     (0 Bytes)                                            ⠴
{
  "Setting": {
    "Name": "myjfs",
    "UUID": "4bdf1c96-c1cd-4450-84af-d16162af60c0",
    "Storage": "minio",
    "Bucket": "http://127.0.0.1:9000/jfs",
    "AccessKey": "minioadmin",
    "SecretKey": "removed",
    "BlockSize": 4096,
    "Compression": "none",
    "EncryptAlgo": "aes256gcm-rsa",
    "KeyEncrypted": true,
    "MetaVersion": 1
  },
  "Sessions": [
    {
      "Sid": 23,
      "Expire": "2022-11-17T12:08:05+08:00",
      "Version": "1.1.0-dev+2022-11-16.efeccc5d",
      "HostName": "Arch",
      "MountPoint": "/mnt/jfs",
      "ProcessID": 279925
    }
  ],
  "Statistic": {
    "UsedSpace": 39661568,
    "AvailableSpace": 1125899867181056,
    "UsedInodes": 607,
    "AvailableInodes": 10485760,
    "DeletedSliceCount": 620237,
    "DeletedSliceSize": 294188398321
  }
}

@CLAassistant
Copy link

CLAassistant commented Nov 14, 2022

CLA assistant check
All committers have signed the CLA.

@Hexilee Hexilee requested review from SandyXSD and davies November 14, 2022 06:26
@codecov-commenter
Copy link

codecov-commenter commented Nov 15, 2022

Codecov Report

Base: 58.76% // Head: 58.63% // Decreases project coverage by -0.12% ⚠️

Coverage data is based on head (1b5e6e2) compared to base (2731d9e).
Patch coverage: 22.13% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2977      +/-   ##
==========================================
- Coverage   58.76%   58.63%   -0.13%     
==========================================
  Files         141      141              
  Lines       24605    24714     +109     
==========================================
+ Hits        14458    14490      +32     
- Misses       8263     8331      +68     
- Partials     1884     1893       +9     
Impacted Files Coverage Δ
pkg/meta/base.go 66.79% <0.00%> (-0.86%) ⬇️
pkg/meta/interface.go 45.45% <ø> (ø)
pkg/meta/sql.go 63.02% <16.66%> (-0.81%) ⬇️
pkg/meta/redis.go 69.01% <22.22%> (-0.75%) ⬇️
pkg/meta/tkv.go 73.97% <27.27%> (-0.47%) ⬇️
cmd/status.go 52.85% <30.00%> (-17.88%) ⬇️
pkg/meta/tkv_etcd.go 71.57% <0.00%> (-1.06%) ⬇️
pkg/meta/tkv_mem.go 86.61% <0.00%> (-0.71%) ⬇️
pkg/object/sftp.go 51.09% <0.00%> (-0.19%) ⬇️
... and 6 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@Hexilee Hexilee force-pushed the scan-delayed-slices-in-status branch from cf1e65b to ab83346 Compare November 15, 2022 08:16
@Hexilee Hexilee changed the title show count and total bytes of delayed deleted slices in status subcommand show more statistic information in status subcommand Nov 15, 2022
@davies davies merged commit f150578 into main Nov 17, 2022
@davies davies deleted the scan-delayed-slices-in-status branch November 17, 2022 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Need a better way to know the total size of delayed deleted slices
4 participants