# k decides how far from normal a template can be

## Baseline templates grouped with k = 4
cluster 0:
    INFO  CatalogController    GET /api/products/<*> <*> in <*> ms  (distance to centre 0.325)
    INFO  InventoryService     Reserved <*> units of SKU-<*>  (distance to centre 0.325)
    INFO  CacheRefresher       Nightly cache refresh completed in <*> ms  (distance to centre 0.321)
cluster 1:
    INFO  OrderController      Order <*> placed by customer c-<*> total=<*>  (distance to centre 0.343)
    INFO  PaymentService       Payment approved for order <*> in <*> ms  (distance to centre 0.212)
    WARN  PaymentService       Payment declined for order <*>: insufficient funds  (distance to centre 0.315)
    ERROR OrderController      Failed to process order <*>: validation failed  (distance to centre 0.339)
cluster 2:
    INFO  AuthFilter           Token validated for user u-<*>  (distance to centre 0.239)
    INFO  HikariPool           HikariPool-<*> - Pool stats (total=<*>, active=<*>, idle=<*>, waiting=<*>)  (distance to centre 0.239)
cluster 3:
    WARN  SlowQueryDetector    Slow query (<*> ms): select * from orders where customer_id = ?  (distance to centre 0.000)

## Distance of the five new templates, and the threshold, for different k (threshold = worst baseline distance + 0.05)
k    worst-normal threshold  | hikari  jdbc  gateway  reword  ledger-fail
1    0.677        0.727      | 0.747*  0.629   0.623   0.470   0.368
2    0.564        0.614      | 0.726*  0.477   0.471   0.410   0.305
4    0.343        0.393      | 0.678*  0.434*  0.459*  0.394*  0.256
10   0.000        0.050      | 0.510*  0.249*  0.401*  0.101*  0.118*
(* = flagged at that threshold)
