twitter / AnomalyDetection

Anomaly Detection with R
GNU General Public License v3.0
3.55k stars 779 forks source link

Millisecond granularity fixes #68

Closed randakar closed 8 years ago

randakar commented 8 years ago

Our system produces data with millisecond precision, from disparate monitoring systems, every 5 minutes. AnomalyDetectionTs() does not really handle data like that properly as-is. The code that tries to figure out what period to use simply hasn't implemented the 'ms' granularity case (nor has it the 'sec' granularity case), and the formatting that is applies in the 'sec' granularity case is never applied to millisecond-precision data making the code blow up on it.

This branch fixes those two problems, though I would suggest rethinking how to detect the 'period' parameter as well (see individual commits for further comments)