[ 
https://issues.apache.org/jira/browse/CASSANDRA-16325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17654203#comment-17654203
 ] 

Paulo Motta commented on CASSANDRA-16325:
-----------------------------------------

The approach looks good to me, but the test was not working in my computer 
because streaming was completed by the time we checked [if the streaming 
metrics were 
updated|https://github.com/apache/cassandra/pull/2058/commits/b217c700892ac1164ebcee0e4333035c1a97ec33#diff-cfc5f5318c05f7dafd83a877597fd56afdadd78e5a48f0d2f9f228289655d01aR183].

Furthermore, since we only [checked that the streaming metrics were updated 
once|https://github.com/apache/cassandra/pull/2058/commits/b217c700892ac1164ebcee0e4333035c1a97ec33#diff-cfc5f5318c05f7dafd83a877597fd56afdadd78e5a48f0d2f9f228289655d01aR225]
 this did not guarantee metrics are updated incrementally since this check 
could be performed *after* the streaming is fully completed.

In order to make this a bit more robust, I did the following changes to 
{{{}testMetricsUpdateIncrementally{}}}:
 * Update cluster size to 2 and RF=2, since this will make node1 transfer all 
of its data to node2 during streaming making it easier to reason about test 
state
 * Create single 10MB sstable on node1 with compression disabled, so we can 
ensure streaming of a single file will update streaming metrics incrementally
 * Check that 3 or more incoming/outgoing bytes are reported during streaming 
from node1 to node2
  * Before, only 2 values are reported: [0, total_streamed_size]
 * Check that final transferred bytes matches expected sstable size (10MB)
 * Test both peer incoming/outgoing metrics as well as total incoming/outgoing 
metrics

I added log statements on the updated test and these are the reported bytes 
before and after this patch:
BEFORE:
{noformat}
OUTGOING [0, 10508890]
INCOMING [0, 10508890]
{noformat}
AFTER
{noformat}
OUTGOING [0, 65536, 131072, 196608, 262144, 327680, 393216, 458752, 524288, 
589824, 655360, 720896, 786432, 851968, 917504, 983040, 1048576, 1114112, 
1179648, 1245184, 1310720, 1376256, 1441792, 1507328, 1572864, 1638400, 
1703936, 1769472, 1835008, 1900544, 1966080, 2031616, 2097152, 2162688, 
2228224, 2293760, 2359296, 2424832, 2490368, 2555904, 2621440, 2686976, 
2752512, 2818048, 2883584, 2949120, 3014656, 3080192, 3276800, 3342336, 
3538944, 3604480, 3670016, 3735552, 3801088, 3866624, 3932160, 3997696, 
4063232, 4128768, 4194304, 4259840, 4325376, 4390912, 4456448, 4521984, 
4587520, 4653056, 4718592, 4784128, 4849664, 4915200, 4980736, 5046272, 
5111808, 5177344, 5242880, 5308416, 5373952, 5439488, 5505024, 5570560, 
5636096, 5701632, 5767168, 5832704, 5898240, 5963776, 6029312, 6094848, 
6160384, 6225920, 6291456, 6356992, 6422528, 6488064, 6553600, 6619136, 
6684672, 6750208, 6815744, 6881280, 6946816, 7012352, 7077888, 7143424, 
7208960, 7274496, 7340032, 7405568, 7471104, 7536640, 7602176, 7667712, 
7733248, 7798784, 7864320, 7929856, 7995392, 8060928, 8126464, 8192000, 
8257536, 8323072, 8388608, 8454144, 8519680, 8585216, 8650752, 8716288, 
8781824, 8847360, 8912896, 8978432, 9043968, 9109504, 9175040, 9240576, 
9306112, 9371648, 9437184, 9502720, 9568256, 9633792, 9699328, 9764864, 
9830400, 9895936, 9961472, 10027008, 10092544, 10158080, 10223616, 10289152, 
10354688, 10420224, 10485760, 10508890]

INCOMING [0, 1051, 4204, 12611, 22070, 28372, 31525, 36777, 44134, 48338, 
55693, 60948, 65151, 67253, 73559, 78814, 89323, 97730, 106137, 112443, 119799, 
128207, 132408, 134510, 138714, 149224, 156581, 164986, 173394, 182852, 196512, 
207022, 217530, 226987, 238546, 248004, 255360, 261666, 266919, 267970, 280581, 
297395, 316313, 329973, 347837, 356243, 365702, 385669, 393026, 403534, 423497, 
443465, 458179, 480245, 499163, 520182, 527538, 545403, 570623, 589538, 597945, 
616862, 642081, 655743, 679915, 706187, 727205, 754527, 783954, 797617, 821786, 
851212, 868025, 909010, 921620, 949993, 982571, 1009893, 1042470, 1063489, 
1089762, 1090813, 1113932, 1141256, 1179088, 1210615, 1244242, 1273666, 
1310450, 1351438, 1395577, 1440761, 1494357, 1541647, 1572125, 1605756, 
1614161, 1615212, 1638331, 1658299, 1680367, 1703488, 1727652, 1762330, 
1775993, 1806466, 1821180, 1837994, 1873722, 1899993, 1924162, 1947283, 
1965147, 1988268, 2026099, 2048168, 2083899, 2097561, 2128036, 2152207, 
2162716, 2191090, 2214208, 2227869, 2250988, 2285667, 2293024, 2306687, 
2335064, 2359233, 2414932, 2424390, 2425441, 2476934, 2489546, 2528430, 
2555754, 2577823, 2613554, 2620909, 2652436, 2686065, 2687116, 2728101, 
2752266, 2756469, 2804811, 2817422, 2818473, 2859457, 2882576, 2905696, 
2942476, 2948781, 2959291, 3013940, 3046520, 3080149, 3096963, 3138998, 
3170524, 3211505, 3229370, 3230421, 3276657, 3330250, 3377539, 3445847, 
3501549, 3538331, 3579316, 3632911, 3699116, 3734848, 3801057, 3843094, 
3866214, 3867265, 3899844, 3931368, 3980761, 3997575, 4017543, 4062734, 
4098462, 4127887, 4166768, 4194090, 4232974, 4259247, 4272909, 4324399, 
4362228, 4390603, 4395857, 4455757, 4497794, 4521963, 4542979, 4587119, 
4591323, 4652276, 4671190, 4718481, 4742653, 4783637, 4830927, 4844588, 
4845639, 4848792, 4905542, 4915000, 4980155, 5045306, 5075783, 5111506, 
5137778, 5176661, 5203984, 5242866, 5248121, 5298566, 5308024, 5363720, 
5373179, 5382637, 5439385, 5442538, 5497184, 5504538, 5557085, 5569694, 
5598068, 5635900, 5666375, 5701055, 5739941, 5766212, 5767263, 5811403, 
5832420, 5839777, 5890218, 5897575, 5917541, 5962728, 5986898, 6028935, 
6090940, 6094093, 6115112, 6160298, 6188675, 6225457, 6231763, 6278003, 
6290614, 6291665, 6327395, 6356819, 6357870, 6396754, 6421973, 6437736, 
6459805, 6460856, 6487130, 6502893, 6521809, 6553337, 6618485, 6651063, 
6683644, 6695203, 6749846, 6787680, 6815005, 6881215, 6892774, 6946366, 
6984196, 7011520, 7023078, 7075622, 7077724, 7105050, 7142883, 7169156, 
7208038, 7274250, 7309982, 7339408, 7367781, 7404560, 7463407, 7470764, 
7477070, 7535924, 7567450, 7602130, 7667288, 7686202, 7732445, 7736649, 
7769224, 7798652, 7800754, 7850147, 7863809, 7923707, 7928961, 7970998, 
7995168, 8002525, 8060320, 8069777, 8125472, 8148592, 8191678, 8228450, 
8256823, 8261027, 8323029, 8354551, 8388181, 8453336, 8466996, 8519543, 
8565783, 8584699, 8608871, 8649854, 8650905, 8691892, 8716065, 8719218, 
8765459, 8781222, 8846376, 8880006, 8912585, 8959874, 8977741, 9012423, 
9043947, 9101750, 9109107, 9158501, 9174265, 9196333, 9240471, 9241522, 
9303527, 9305629, 9370781, 9385493, 9436991, 9495844, 9502148, 9522115, 
9567305, 9633510, 9680800, 9698666, 9760672, 9763824, 9796404, 9830031, 
9895187, 9929864, 9961385, 10026543, 10091696, 10157897, 10158948, 10223050, 
10261934, 10288206, 10330241, 10354411, 10364918, 10419565, 10420616, 10484719, 
10508890]
{noformat}
[~isaacreath] I created a PR to your branch with the tests changes on 
[https://github.com/isaacreath/cassandra/pull/1]

> Update streaming metrics incrementally
> --------------------------------------
>
>                 Key: CASSANDRA-16325
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-16325
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Observability/Metrics
>            Reporter: Paulo Motta
>            Assignee: Isaac Reath
>            Priority: Normal
>              Labels: lhf
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Currently the inbound and outbound streamed bytes metrics are incremented 
> after each file is streamed, what doesn't represent the current number of 
> bytes streamed since it can take a long time for a large file to be streamed. 
> We should update the metric incrementally as data is streamed.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to