Skip to content

Support float values of metrics #63

@macbre

Description

@macbre

https://github.com/Wikia/Mike/blob/master/example.yaml#L22-L26

Metrics formatting

>>> '%d' % (3.14)
'3'
>>> '%f' % (3.14)
'3.140000'
>>> '%.2f' % (3.14)
'3.14'
>>> '%.1f' % (3.14)
'3.1'

Test table

mysql> select * from mike_test;
+---------+--------+------------+-------+
| user_id | name   | user_group | value |
+---------+--------+------------+-------+
|       1 | Mike   | admin      |  0.00 |
|       2 | Macbre | admin      |  0.00 |
|       3 | Monty  | user       |  3.46 |
+---------+--------+------------+-------+
3 rows in set (0,00 sec)

Alter schema

To make these changes work you need to alter your storage schema:

ALTER TABLE `features_metrics` CHANGE `value` `value` DECIMAL(20, 2) NOT NULL;

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions