From: Alex D. <al...@cr...> - 2011-04-19 15:49:23
|
On Apr 19, 2011, at 9:59 AM, Markus Köberl wrote: > On Tuesday 19 April 2011, Alex Dean wrote: >> On Apr 19, 2011, at 8:34 AM, Markus Köberl wrote: >>> { "metric": "cpu_num", "color": "00FF00", "label": "Nodes", "line_width": >>> "2", "type": "line", "DS": "num", "context": { "cluster": true, "meta": >>> true } } >> >> This seems like a good idea to me. >> >> What about formatting like this: >> { "metric": "cpu_num", "color": "00FF00", "label": "Nodes", "line_width": >> "2", "type": "line", "DS": "num", "contexts": ["cluster", "meta"] } >> >> You could implement with: >> if ( isSet($item[ 'contexts' ]) && array_key_exists($context, >> $item['contexts']) ) { continue; >> } >> >> The context names seem like data here, not keys, so I just thought an array >> might be more appropriate. > > Yes, it is much simpler now. > > Markus Ah, yeah, especially since my suggested change implemented the opposite of your idea. Oops. :) Also, I'm remembering to reply to everyone this time. alex |