You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Ian Downes <ia...@gmail.com> on 2015/10/16 20:00:11 UTC

Re: Review Request 38117: Export per container SNMP statistics

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/38117/#review102933
-----------------------------------------------------------



include/mesos/mesos.proto (lines 702 - 720)
<https://reviews.apache.org/r/38117/#comment160766>

    Are the statistics signed? If not, suggest using uint64 type.



src/slave/containerizer/isolators/network/port_mapping.cpp (line 1139)
<https://reviews.apache.org/r/38117/#comment160779>

    No need to store all statistics until the end. Key/value lines for a set of statistics are paired so you can add*Statistics after processing each line pair. Then you just need a scoped {{hashmap<string, int64_t> statistics}}.



src/slave/containerizer/isolators/network/port_mapping.cpp (lines 1140 - 1141)
<https://reviews.apache.org/r/38117/#comment160778>

    Clearer to just declare these inside the loop scope (but my suggestions below obviate them anyway).



src/slave/containerizer/isolators/network/port_mapping.cpp (line 1142)
<https://reviews.apache.org/r/38117/#comment160777>

    you don't care about the actual line number, just that you want to toggle between "key" and "value" lines, suggest something like "bool isKeyLine" and toggle that?



src/slave/containerizer/isolators/network/port_mapping.cpp (line 1144)
<https://reviews.apache.org/r/38117/#comment160770>

    Suggest splitting first on ":" to get the statistics type and keys/values, then tokenize on " ". You can also validate the type then as well.



src/slave/containerizer/isolators/network/port_mapping.cpp (line 1146)
<https://reviews.apache.org/r/38117/#comment160774>

    If you split first on ":" then you don't need a separate keys vector.



src/slave/containerizer/isolators/network/port_mapping.cpp (lines 1150 - 1159)
<https://reviews.apache.org/r/38117/#comment160775>

    Assuming you've got the type from splitting on ":" and then you've got the keys, you can directly insert val into a statistics hashmap after successfully numifying it, i.e., no need for an intermediate values vector.



src/slave/containerizer/isolators/network/port_mapping.cpp (lines 1161 - 1165)
<https://reviews.apache.org/r/38117/#comment160780>

    This is an unnecessary mix of indexing and foreach looping. Comments above make this unnecessary but just FYI.



src/slave/containerizer/isolators/network/port_mapping.cpp (line 1162)
<https://reviews.apache.org/r/38117/#comment160783>

    This should be a {{const string&}} (if kept).



src/slave/containerizer/isolators/network/port_mapping.cpp (line 1169)
<https://reviews.apache.org/r/38117/#comment160782>

    Toggle line type here.



src/slave/containerizer/isolators/network/port_mapping.cpp (lines 1171 - 1174)
<https://reviews.apache.org/r/38117/#comment160781>

    Do these inside the parsing loop as you parse each line pair for a statistics type.


- Ian Downes


On Sept. 8, 2015, 2:12 p.m., Cong Wang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/38117/
> -----------------------------------------------------------
> 
> (Updated Sept. 8, 2015, 2:12 p.m.)
> 
> 
> Review request for mesos, Jie Yu, Paul Brett, and Vinod Kone.
> 
> 
> Bugs: MESOS-3365
>     https://issues.apache.org/jira/browse/MESOS-3365
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> These stats are those we get by `netstat -s`, they are important for diagnose networking issues.
> 
> 
> Diffs
> -----
> 
>   include/mesos/mesos.proto b1deed4720cab4a89db76a48bc9563bba4f5bf1c 
>   src/slave/containerizer/isolators/network/port_mapping.hpp 4bca0b81bf69fb4cd75e05aacd02d3e818e32d09 
>   src/slave/containerizer/isolators/network/port_mapping.cpp 34ba2294b0bd7d57aa9de073692a2ea8ec62681d 
>   src/slave/flags.hpp b8335aa585376d27b71897f8cbaefaa12f4b3a5c 
>   src/slave/flags.cpp 7539441c685828027db07173e62a4e5fc1e8b54d 
> 
> Diff: https://reviews.apache.org/r/38117/diff/
> 
> 
> Testing
> -------
> 
> Manual tests
> 
> 
> Thanks,
> 
> Cong Wang
> 
>


Re: Review Request 38117: Export per container SNMP statistics

Posted by Cong Wang <cw...@twopensource.com>.

> On Oct. 16, 2015, 6 p.m., Ian Downes wrote:
> > include/mesos/mesos.proto, lines 702-720
> > <https://reviews.apache.org/r/38117/diff/2/?file=1065464#file1065464line702>
> >
> >     Are the statistics signed? If not, suggest using uint64 type.

Yes, I used uint64 initially and then noticed some TCP stat is -1. :)


> On Oct. 16, 2015, 6 p.m., Ian Downes wrote:
> > src/slave/containerizer/isolators/network/port_mapping.cpp, lines 1171-1174
> > <https://reviews.apache.org/r/38117/diff/2/?file=1065466#file1065466line1171>
> >
> >     Do these inside the parsing loop as you parse each line pair for a statistics type.

The problem is we don't expose all SNMP stats from kernel here, for example we don't care about UDPlite.


> On Oct. 16, 2015, 6 p.m., Ian Downes wrote:
> > src/slave/containerizer/isolators/network/port_mapping.cpp, lines 1140-1141
> > <https://reviews.apache.org/r/38117/diff/2/?file=1065466#file1065466line1140>
> >
> >     Clearer to just declare these inside the loop scope (but my suggestions below obviate them anyway).

If declared inside the loop, its value can't be kept for the next loop, right? We need to at least keep keys across one loop.


- Cong


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/38117/#review102933
-----------------------------------------------------------


On Sept. 8, 2015, 9:12 p.m., Cong Wang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/38117/
> -----------------------------------------------------------
> 
> (Updated Sept. 8, 2015, 9:12 p.m.)
> 
> 
> Review request for mesos, Jie Yu, Paul Brett, and Vinod Kone.
> 
> 
> Bugs: MESOS-3365
>     https://issues.apache.org/jira/browse/MESOS-3365
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> These stats are those we get by `netstat -s`, they are important for diagnose networking issues.
> 
> 
> Diffs
> -----
> 
>   include/mesos/mesos.proto b1deed4720cab4a89db76a48bc9563bba4f5bf1c 
>   src/slave/containerizer/isolators/network/port_mapping.hpp 4bca0b81bf69fb4cd75e05aacd02d3e818e32d09 
>   src/slave/containerizer/isolators/network/port_mapping.cpp 34ba2294b0bd7d57aa9de073692a2ea8ec62681d 
>   src/slave/flags.hpp b8335aa585376d27b71897f8cbaefaa12f4b3a5c 
>   src/slave/flags.cpp 7539441c685828027db07173e62a4e5fc1e8b54d 
> 
> Diff: https://reviews.apache.org/r/38117/diff/
> 
> 
> Testing
> -------
> 
> Manual tests
> 
> 
> Thanks,
> 
> Cong Wang
> 
>