pcp
[Top] [All Lists]

Re: [pcp] RFC: allowing longer metric and instance names in MMV(5) forma

To: Suyash <dextrous93@xxxxxxxxx>
Subject: Re: [pcp] RFC: allowing longer metric and instance names in MMV(5) format
From: Nathan Scott <nathans@xxxxxxxxxx>
Date: Thu, 30 Jun 2016 00:21:04 -0400 (EDT)
Cc: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>, Paul Smith <psmith@xxxxxxxxxx>, Ryan Doyle <rdoyle@xxxxxxxxxx>, Lukas Berk <lberk@xxxxxxxxxx>, pcp developers <pcp@xxxxxxxxxxx>
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <CANzwyvyAtwThrzScLorhAY9QzXXbFgzJ+62aAuDOKqyjHi4beQ@xxxxxxxxxxxxxx>
References: <236242739.2883373.1467174433044.JavaMail.zimbra@xxxxxxxxxx> <354261953.2889296.1467178515176.JavaMail.zimbra@xxxxxxxxxx> <012901d1d249$5be820c0$13b86240$@internode.on.net> <1707944027.3111801.1467244100148.JavaMail.zimbra@xxxxxxxxxx> <CANzwyvyAtwThrzScLorhAY9QzXXbFgzJ+62aAuDOKqyjHi4beQ@xxxxxxxxxxxxxx>
Reply-to: Nathan Scott <nathans@xxxxxxxxxx>
Thread-index: D5W22GbbtgzwpUgjBVAzLVkCSzPMuw==
Thread-topic: allowing longer metric and instance names in MMV(5) format
Hi Suyash,

----- Original Message -----
> Hi everyone,
> 
> Suyash from speed here

(Speed being the awesome new Go MMV client implementation! :)

> Sorry for the late response.

No problem, and thanks for your thoughts Suyash.

> I completely agree with the idea of backwards compatibility, and from
> speed's standpoint, it is only about turning the metric name to
> `*PCPString` type instead of a normal `string` type and caching the address
> where it is written.

OK, good stuff.

> The only concern is we will still use 64 bytes for metric name for each
> metric, despite needing only need 8, but we use 64 bytes anyway, no matter
> what the length of the actual name (

That size of struct, while a little wasteful, is OK in general I guess - it's
a bit of a tradeoff.  We try to keep everything at fixed, immovable offsets
in MMV, and this is the price thats paid - small amounts of unused memory all
over the place (sometimes called "internal fragmentation").  In our case, and
for the numbers of metrics typically in use it's not considered too wasteful
in the bigger scheme of things, so we just grin and bear it.

That said, the v2 metric/instance structures are a little bit smaller than v1
but they point to additional string sections (which do add a bit more too).

cheers.

--
Nathan

<Prev in Thread] Current Thread [Next in Thread>