fandrei / AppMetrics

Apache License 2.0
8 stars 2 forks source link

Metronome to trigger {Name}Monitor.Execute() based on config #71

Closed mrdavidlaing closed 12 years ago

mrdavidlaing commented 12 years ago
abstract class Monitor { prop Name, method Execute() }
DefaultPageMonitor: Monitor -> Execute() calls IIS default url
AllServiceMonitor: Monitor -> Execute() calls all the service urls

Metronome ->

  1. loads up all the Monitors into an array,
  2. calls the Execute of each at the frequency defined in the config file

Config:

<Monitors>
    <Monitor Class="DefaultPageMonitor" ExecutePeriodInSec="20" />
    <Monitor Class="AllServiceMonitor" ExecutePeriodInSec="60">
         <AllServiceMonitorConfig  UserName="XX627345" Password="sdfsdf" /> 
    </Monitor>
</Monitors>

AllServiceMonitorConfig node is an example of a serialised config DTO for the specific Monitor. Different monitors could have different config nodes, or none at all

fandrei commented 12 years ago

Is it really necessary to have separate user name/password for every monitor? This makes configuration process more complicated.

mrdavidlaing commented 12 years ago

Yes, I'm afraid so.

And in some cases we might want to run the same monitor twice on the same machine, but using different urls or username/passwords

On 23 May 2012 09:03, fandrei < reply@reply.github.com

wrote:

Is it really necessary to have separate user name/password for every monitor? This makes configuration process more complicated.


Reply to this email directly or view it on GitHub: https://github.com/fandrei/AppMetrics/issues/71#issuecomment-5867244

David Laing Open source @ City Index - github.com/cityindex http://davidlaing.com Twitter: @davidlaing

fandrei commented 12 years ago

ok, config looks like this:

<LatencyMonitor xsi:type="DefaultPageMonitor">
  <PeriodSeconds>10</PeriodSeconds>
</LatencyMonitor>
<LatencyMonitor xsi:type="AllServiceMonitor">
  <PeriodSeconds>20</PeriodSeconds>
  <UserName>XX870869</UserName>
  <Password>some password</Password>
  <ServerUrl>https://ciapi.cityindex.com/TradingApi</ServerUrl>
  <StreamingServerUrl>https://push.cityindex.com</StreamingServerUrl>
  <AllowTrading>false</AllowTrading>
</LatencyMonitor>

Any ideas how to deal with passwords? I don't like idea of storing passwords in plain text. Currently password is encrypted and can be set via config tool, but having multiple plugins makes this much more complicated.

mrdavidlaing commented 12 years ago

Best thing I can think of is to let the OS handle security on the file - i.e, prevent reading by any user except Admin & service user

fandrei commented 12 years ago

I've tried a different way: passwords are stored encrypted, but they can be set and viewed using the config tool; it's also possible to set monitors config using command line:

CiapiLatencyCollectorConfig.exe "-monitors:<Monitors xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><LatencyMonitor xsi:type=\"DefaultPageMonitor\" />"

or maybe it's better to specify file name instead?

fandrei commented 12 years ago

ok, let's move discussion on config system here https://github.com/fandrei/AppMetrics/issues/79