Skip to content

Detailed storage stats#1120

Merged
borshop merged 13 commits into
2.0from
feature/detailed-storage-stats
Apr 13, 2015
Merged

Detailed storage stats#1120
borshop merged 13 commits into
2.0from
feature/detailed-storage-stats

Conversation

@shino

@shino shino commented Apr 9, 2015

Copy link
Copy Markdown
Contributor

This PR adds several classes for storage calculation.

  • user: user accessible, this is the sum of Active and WritingMultipart.
  • Active: active manifests
  • ActiveInvisible: active but not user accessible
  • WritingMultipart: writing Multipart
  • WritingNew: writing non-MP, within leeway (maybe actively uploading)
  • WritingOld: writing non-MP, out of leeway (probably orphan)
  • PendingDeleteNew: pending_delete, within leeway (maybe being moved to GC bucket right now)
  • PendingDeleteOld: pending_delete, out of leeway (probably failed to be moved)
  • ScheduledDeleteNew: scheduled_delete, within leeway (normal, just staying as is)
  • ScheduledDeleteOld: scheduled_delete, out of leeway (GC can collect but not catches up)

Each cass has three counters for object count (Objects),
bytes (Bytes) and blocks (Blocks). One exception is for user,
no prefix and only Objects, Bytes and Blocks.
The key in JSON/XML usage response looks like WritingMultipartBytes.

Sample JSON output: https://gist.github.com/shino/1be474a0f5b949f47c91

Future tasks:

  • Calculate deleted buckets. Deleted buckets can hold non-active manifests and corresponding blocks reside on disks. This PR does not calculate stats for them.
  • Cleanup lingering objects like old writing or pending_delete manifests.

@shino shino added this to the 2.0.1 milestone Apr 9, 2015
@shino shino force-pushed the feature/detailed-storage-stats branch from a30623a to 78b3775 Compare April 10, 2015 07:58
@shino shino changed the title [WIP] Detailed storage stats Detailed storage stats Apr 10, 2015
@shino

shino commented Apr 10, 2015

Copy link
Copy Markdown
Contributor Author

Ready for review 👀

@kuenishi

Copy link
Copy Markdown
Contributor

Also addresses #1054 (RCS-107)

@kuenishi

Copy link
Copy Markdown
Contributor

I'd rather prefer non-two-char-acronym like this:

  • Active : user accessible
  • ActiveInvisible : active but not user accessible
  • WritingMultiPart : writing MP, items in this class are doubly counted with user
  • WritingNew : writing non-MP, within leeway (maybe actively uploading)
  • WritingOld : writing non-MP, out of leeway (probably orphan)
  • PendingDeleteNew : pending_delete, within leeway (maybe being moved to GC bucket right now)
  • PendingDeleteOld: pending_delete, out of leeway (probably failed to be moved)
  • ScheduledDeleteNew : scheduled_delete, within leeway (normal, just staying as is)
  • ScheduledDeleteOld : scheduled_delete, out of leeway (GC can collect but not catches up)

With all of them having suffix Bytes Counts and Blocks

@shino

shino commented Apr 13, 2015

Copy link
Copy Markdown
Contributor Author

Nice naming!

I will change only one item Active: user accessible because we use active for another meaning, i.e. one of the states of manifests.

Comment thread src/riak_cs_storage_mr.erl Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's use latest year for new files.

Shunichi Shinohara added 2 commits April 13, 2015 16:01
In non-detailed storage calculation, MP contributes to "Objects" as
- the number of parts when writing and
- 1 when active.

For backward compatibility, extend it as
- the number of parts when writing and
- 1 when active, pending_delete and scheduled_delete
Comment thread src/riak_cs_storage_mr.erl Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just for code readability, I'd also prefer not using two-chars-acronym. Maybe codes get ugly?

@kuenishi

Copy link
Copy Markdown
Contributor
16:26:04.514 [info] ./s3_conf.sh: 1: ./s3_conf.sh: uuidgen: not found

Fmm, accidentally I've found this is not documented...

@shino

shino commented Apr 13, 2015

Copy link
Copy Markdown
Contributor Author

Where to write it? ceph_test README?

@shino

shino commented Apr 13, 2015

Copy link
Copy Markdown
Contributor Author

Please give me your environment information and install command for the dep.

@kuenishi

Copy link
Copy Markdown
Contributor

I think riak_test/README.md is suitable.

@kuenishi

Copy link
Copy Markdown
Contributor

For mine, apt-get install uuid-runtime was required.

@kuenishi

Copy link
Copy Markdown
Contributor

Mine was

$ uname -a
Linux nausicaa 3.2.0-4-amd64 #1 SMP Debian 3.2.65-1+deb7u2 x86_64 GNU/Linux

@shino

shino commented Apr 13, 2015

Copy link
Copy Markdown
Contributor Author

I hope this became ready for review again.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So, user = active + writing_multipart ? Or MP is just for number of parts?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

So, user = active + writing_multipart ?

Yes

@shino

shino commented Apr 13, 2015

Copy link
Copy Markdown
Contributor Author

pushed

@kuenishi

Copy link
Copy Markdown
Contributor

Looks nice. Will run r_t and eventually +1.

borshop added a commit that referenced this pull request Apr 13, 2015
Detailed storage stats

Reviewed-by: kuenishi
@kuenishi

Copy link
Copy Markdown
Contributor

@borshop merge

@borshop borshop merged commit 715ee28 into 2.0 Apr 13, 2015
@shino shino deleted the feature/detailed-storage-stats branch April 13, 2015 23:50
@kuenishi

Copy link
Copy Markdown
Contributor

Even it's after merge, I tested, data stored in storage bucket has some strange form:

$ curl -s http://localhost:8098/buckets/moss.storage/keys/20150414T000000Z.admin-key  | jq '.'                                                
{
  "StartTime": "20150414T004958Z",
  "EndTime": "20150414T005000Z",
  "test": {
    "WrOldCt": 0,
    "WrOldBy": 0,
    "WrOldBl": 0,
    "WrNewCt": 0,
    "WrNewBy": 0,
    "WrNewBl": 0,
    "WrMpCt": 14,
    "WrMpBy": 220200960,
    "WrMpBl": 210,
    "Ct": 32436,
    "By": 1438887763,
    "Bl": 33156,
    "SdOldCt": 0,
    "SdOldBy": 0,
    "SdOldBl": 0,
    "SdNewCt": 71,
    "SdNewBy": 838860822,
    "SdNewBl": 811,
    "PdOldCt": 0,
    "PdOldBy": 0,
    "PdOldBl": 0,
    "PdNewCt": 0,
    "PdNewBy": 0,
    "PdNewBl": 0,
    "AcDeCt": 0,
    "AcDeBy": 0,
    "AcDeBl": 0
  }
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe this might be simpler?

bucket_summary_fold(Sums) ->
   lists:foldl(fun(Sum, Acc) -> orddict:merge(fun(K, V1, V2) -> V1+V2 end, Sum, Acc) end,
                     orddict:new(), Sums).

@kuenishi

Copy link
Copy Markdown
Contributor

Make clean and stage again made it working. Something was wrong...

@kuenishi kuenishi restored the feature/detailed-storage-stats branch April 28, 2015 01:23
@kuenishi kuenishi deleted the feature/detailed-storage-stats branch April 28, 2015 01:24
kuenishi added a commit that referenced this pull request Apr 28, 2015
@kuenishi kuenishi modified the milestones: 2.1.0, 2.0.1 Apr 28, 2015
borshop added a commit that referenced this pull request Apr 28, 2015
Revert #1118, #1120 and #1123 from release notes

Reviewed-by: shino
@kuenishi kuenishi modified the milestones: 2.2.0, 2.1.0 Apr 28, 2015
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.

3 participants