first draft for lcr docs

This commit is contained in:
Radu Ioan Fericean
2015-04-07 21:27:46 +03:00
parent 27f7e6d9ca
commit 34ca406e88
5 changed files with 80 additions and 1 deletions

View File

@@ -676,7 +676,11 @@ func (cd *CallDescriptor) GetLCR(stats StatsInterface) (LCRCost, error) {
if err != nil {
return nil, err
}
// sort by activation time
lcr.Sort()
// find if one ore more entries apply to this cd (create lcr timespans)
// create timespans and attach lcr entries to them
lcrCost := LCRCost{&LCRTimeSpan{StartTime: cd.TimeStart}}
for _, lcrActivation := range lcr.Activations {
//log.Printf("Activation: %+v", lcrActivation)

View File

@@ -183,6 +183,8 @@ func TestLcrGet(t *testing.T) {
Subject: "rif",
}
lcrs, err := cd.GetLCR(nil)
//lcr, _ := json.Marshal(lcrs[0])
//log.Print("LCR: ", string(lcr))
if err != nil || len(lcrs) != 1 {
t.Errorf("Bad lcr: %+v, %v", lcrs, err)
}