Increment a Counter and Echo a Message
The listing below increments a counter and echoes the counter's value when AMPS receives the USR1
signal.
<Actions>
<Action>
<On>
<Module>amps-action-on-signal</Module>
<Options>
<Signal>SIGUSR1</Signal>
</Options>
</On>
<Do>
<Module>amps-action-do-increment-counter</Module>
<Options>
<Key>MY_COUNTER</Key>
<Value>CURRENT_COUNTER_VALUE</Value>
</Options>
</Do>
<Do>
<Module>amps-action-do-echo-message</Module>
<Options>
<Message>AMPS has gotten {{CURRENT_COUNTER_VALUE}}
SIGUSR1 signals.</Message>
</Options>
</Do>
</Action>
</Actions>
Last updated