2016-04-13 07:08:22 -07:00
|
|
|
// Copyright 2016 The Prometheus Authors
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
2015-05-06 07:53:12 -07:00
|
|
|
package local
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2015-08-20 08:18:46 -07:00
|
|
|
"github.com/prometheus/common/model"
|
2015-05-06 07:53:12 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
// cm11, cm12, cm13 are colliding with fp1.
|
|
|
|
// cm21, cm22 are colliding with fp2.
|
|
|
|
// cm31, cm32 are colliding with fp3, which is below maxMappedFP.
|
|
|
|
// Note that fingerprints are set and not actually calculated.
|
|
|
|
// The collision detection is independent from the actually used
|
|
|
|
// fingerprinting algorithm.
|
2015-08-20 08:18:46 -07:00
|
|
|
fp1 = model.Fingerprint(maxMappedFP + 1)
|
|
|
|
fp2 = model.Fingerprint(maxMappedFP + 2)
|
|
|
|
fp3 = model.Fingerprint(1)
|
|
|
|
cm11 = model.Metric{
|
2015-05-06 07:53:12 -07:00
|
|
|
"foo": "bar",
|
|
|
|
"dings": "bumms",
|
|
|
|
}
|
2015-08-20 08:18:46 -07:00
|
|
|
cm12 = model.Metric{
|
2015-05-06 07:53:12 -07:00
|
|
|
"bar": "foo",
|
|
|
|
}
|
2015-08-20 08:18:46 -07:00
|
|
|
cm13 = model.Metric{
|
2015-05-06 07:53:12 -07:00
|
|
|
"foo": "bar",
|
|
|
|
}
|
2015-08-20 08:18:46 -07:00
|
|
|
cm21 = model.Metric{
|
2015-05-06 07:53:12 -07:00
|
|
|
"foo": "bumms",
|
|
|
|
"dings": "bar",
|
|
|
|
}
|
2015-08-20 08:18:46 -07:00
|
|
|
cm22 = model.Metric{
|
2015-05-06 07:53:12 -07:00
|
|
|
"dings": "foo",
|
|
|
|
"bar": "bumms",
|
|
|
|
}
|
2015-08-20 08:18:46 -07:00
|
|
|
cm31 = model.Metric{
|
2015-05-06 07:53:12 -07:00
|
|
|
"bumms": "dings",
|
|
|
|
}
|
2015-08-20 08:18:46 -07:00
|
|
|
cm32 = model.Metric{
|
2015-05-06 07:53:12 -07:00
|
|
|
"bumms": "dings",
|
|
|
|
"bar": "foo",
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestFPMapper(t *testing.T) {
|
|
|
|
sm := newSeriesMap()
|
|
|
|
|
|
|
|
p, closer := newTestPersistence(t, 1)
|
|
|
|
defer closer.Close()
|
|
|
|
|
|
|
|
mapper, err := newFPMapper(sm, p)
|
|
|
|
|
|
|
|
// Everything is empty, resolving a FP should do nothing.
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
gotFP := mapper.mapFP(fp1, cm11)
|
2015-05-06 07:53:12 -07:00
|
|
|
if wantFP := fp1; gotFP != wantFP {
|
|
|
|
t.Errorf("got fingerprint %v, want fingerprint %v", gotFP, wantFP)
|
|
|
|
}
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
gotFP = mapper.mapFP(fp1, cm12)
|
2015-05-06 07:53:12 -07:00
|
|
|
if wantFP := fp1; gotFP != wantFP {
|
|
|
|
t.Errorf("got fingerprint %v, want fingerprint %v", gotFP, wantFP)
|
|
|
|
}
|
|
|
|
|
|
|
|
// cm11 is in sm. Adding cm11 should do nothing. Mapping cm12 should resolve
|
|
|
|
// the collision.
|
|
|
|
sm.put(fp1, &memorySeries{metric: cm11})
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
gotFP = mapper.mapFP(fp1, cm11)
|
2015-05-06 07:53:12 -07:00
|
|
|
if wantFP := fp1; gotFP != wantFP {
|
|
|
|
t.Errorf("got fingerprint %v, want fingerprint %v", gotFP, wantFP)
|
|
|
|
}
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
gotFP = mapper.mapFP(fp1, cm12)
|
2015-08-20 08:18:46 -07:00
|
|
|
if wantFP := model.Fingerprint(1); gotFP != wantFP {
|
2015-05-06 07:53:12 -07:00
|
|
|
t.Errorf("got fingerprint %v, want fingerprint %v", gotFP, wantFP)
|
|
|
|
}
|
|
|
|
|
|
|
|
// The mapped cm12 is added to sm, too. That should not change the outcome.
|
2015-08-20 08:18:46 -07:00
|
|
|
sm.put(model.Fingerprint(1), &memorySeries{metric: cm12})
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
gotFP = mapper.mapFP(fp1, cm11)
|
2015-05-06 07:53:12 -07:00
|
|
|
if wantFP := fp1; gotFP != wantFP {
|
|
|
|
t.Errorf("got fingerprint %v, want fingerprint %v", gotFP, wantFP)
|
|
|
|
}
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
gotFP = mapper.mapFP(fp1, cm12)
|
2015-08-20 08:18:46 -07:00
|
|
|
if wantFP := model.Fingerprint(1); gotFP != wantFP {
|
2015-05-06 07:53:12 -07:00
|
|
|
t.Errorf("got fingerprint %v, want fingerprint %v", gotFP, wantFP)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Now map cm13, should reproducibly result in the next mapped FP.
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
gotFP = mapper.mapFP(fp1, cm13)
|
2015-08-20 08:18:46 -07:00
|
|
|
if wantFP := model.Fingerprint(2); gotFP != wantFP {
|
2015-05-06 07:53:12 -07:00
|
|
|
t.Errorf("got fingerprint %v, want fingerprint %v", gotFP, wantFP)
|
|
|
|
}
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
gotFP = mapper.mapFP(fp1, cm13)
|
2015-08-20 08:18:46 -07:00
|
|
|
if wantFP := model.Fingerprint(2); gotFP != wantFP {
|
2015-05-06 07:53:12 -07:00
|
|
|
t.Errorf("got fingerprint %v, want fingerprint %v", gotFP, wantFP)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Add cm13 to sm. Should not change anything.
|
2015-08-20 08:18:46 -07:00
|
|
|
sm.put(model.Fingerprint(2), &memorySeries{metric: cm13})
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
gotFP = mapper.mapFP(fp1, cm11)
|
2015-05-06 07:53:12 -07:00
|
|
|
if wantFP := fp1; gotFP != wantFP {
|
|
|
|
t.Errorf("got fingerprint %v, want fingerprint %v", gotFP, wantFP)
|
|
|
|
}
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
gotFP = mapper.mapFP(fp1, cm12)
|
2015-08-20 08:18:46 -07:00
|
|
|
if wantFP := model.Fingerprint(1); gotFP != wantFP {
|
2015-05-06 07:53:12 -07:00
|
|
|
t.Errorf("got fingerprint %v, want fingerprint %v", gotFP, wantFP)
|
|
|
|
}
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
gotFP = mapper.mapFP(fp1, cm13)
|
2015-08-20 08:18:46 -07:00
|
|
|
if wantFP := model.Fingerprint(2); gotFP != wantFP {
|
2015-05-06 07:53:12 -07:00
|
|
|
t.Errorf("got fingerprint %v, want fingerprint %v", gotFP, wantFP)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Now add cm21 and cm22 in the same way, checking the mapped FPs.
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
gotFP = mapper.mapFP(fp2, cm21)
|
2015-05-06 07:53:12 -07:00
|
|
|
if wantFP := fp2; gotFP != wantFP {
|
|
|
|
t.Errorf("got fingerprint %v, want fingerprint %v", gotFP, wantFP)
|
|
|
|
}
|
|
|
|
sm.put(fp2, &memorySeries{metric: cm21})
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
gotFP = mapper.mapFP(fp2, cm21)
|
2015-05-06 07:53:12 -07:00
|
|
|
if wantFP := fp2; gotFP != wantFP {
|
|
|
|
t.Errorf("got fingerprint %v, want fingerprint %v", gotFP, wantFP)
|
|
|
|
}
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
gotFP = mapper.mapFP(fp2, cm22)
|
2015-08-20 08:18:46 -07:00
|
|
|
if wantFP := model.Fingerprint(3); gotFP != wantFP {
|
2015-05-06 07:53:12 -07:00
|
|
|
t.Errorf("got fingerprint %v, want fingerprint %v", gotFP, wantFP)
|
|
|
|
}
|
2015-08-20 08:18:46 -07:00
|
|
|
sm.put(model.Fingerprint(3), &memorySeries{metric: cm22})
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
gotFP = mapper.mapFP(fp2, cm21)
|
2015-05-06 07:53:12 -07:00
|
|
|
if wantFP := fp2; gotFP != wantFP {
|
|
|
|
t.Errorf("got fingerprint %v, want fingerprint %v", gotFP, wantFP)
|
|
|
|
}
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
gotFP = mapper.mapFP(fp2, cm22)
|
2015-08-20 08:18:46 -07:00
|
|
|
if wantFP := model.Fingerprint(3); gotFP != wantFP {
|
2015-05-06 07:53:12 -07:00
|
|
|
t.Errorf("got fingerprint %v, want fingerprint %v", gotFP, wantFP)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Map cm31, resulting in a mapping straight away.
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
gotFP = mapper.mapFP(fp3, cm31)
|
2015-08-20 08:18:46 -07:00
|
|
|
if wantFP := model.Fingerprint(4); gotFP != wantFP {
|
2015-05-06 07:53:12 -07:00
|
|
|
t.Errorf("got fingerprint %v, want fingerprint %v", gotFP, wantFP)
|
|
|
|
}
|
2015-08-20 08:18:46 -07:00
|
|
|
sm.put(model.Fingerprint(4), &memorySeries{metric: cm31})
|
2015-05-06 07:53:12 -07:00
|
|
|
|
|
|
|
// Map cm32, which is now mapped for two reasons...
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
gotFP = mapper.mapFP(fp3, cm32)
|
2015-08-20 08:18:46 -07:00
|
|
|
if wantFP := model.Fingerprint(5); gotFP != wantFP {
|
2015-05-06 07:53:12 -07:00
|
|
|
t.Errorf("got fingerprint %v, want fingerprint %v", gotFP, wantFP)
|
|
|
|
}
|
2015-08-20 08:18:46 -07:00
|
|
|
sm.put(model.Fingerprint(5), &memorySeries{metric: cm32})
|
2015-05-06 07:53:12 -07:00
|
|
|
|
|
|
|
// Now check ALL the mappings, just to be sure.
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
gotFP = mapper.mapFP(fp1, cm11)
|
2015-05-06 07:53:12 -07:00
|
|
|
if wantFP := fp1; gotFP != wantFP {
|
|
|
|
t.Errorf("got fingerprint %v, want fingerprint %v", gotFP, wantFP)
|
|
|
|
}
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
gotFP = mapper.mapFP(fp1, cm12)
|
2015-08-20 08:18:46 -07:00
|
|
|
if wantFP := model.Fingerprint(1); gotFP != wantFP {
|
2015-05-06 07:53:12 -07:00
|
|
|
t.Errorf("got fingerprint %v, want fingerprint %v", gotFP, wantFP)
|
|
|
|
}
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
gotFP = mapper.mapFP(fp1, cm13)
|
2015-08-20 08:18:46 -07:00
|
|
|
if wantFP := model.Fingerprint(2); gotFP != wantFP {
|
2015-05-06 07:53:12 -07:00
|
|
|
t.Errorf("got fingerprint %v, want fingerprint %v", gotFP, wantFP)
|
|
|
|
}
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
gotFP = mapper.mapFP(fp2, cm21)
|
2015-05-06 07:53:12 -07:00
|
|
|
if wantFP := fp2; gotFP != wantFP {
|
|
|
|
t.Errorf("got fingerprint %v, want fingerprint %v", gotFP, wantFP)
|
|
|
|
}
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
gotFP = mapper.mapFP(fp2, cm22)
|
2015-08-20 08:18:46 -07:00
|
|
|
if wantFP := model.Fingerprint(3); gotFP != wantFP {
|
2015-05-06 07:53:12 -07:00
|
|
|
t.Errorf("got fingerprint %v, want fingerprint %v", gotFP, wantFP)
|
|
|
|
}
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
gotFP = mapper.mapFP(fp3, cm31)
|
2015-08-20 08:18:46 -07:00
|
|
|
if wantFP := model.Fingerprint(4); gotFP != wantFP {
|
2015-05-06 07:53:12 -07:00
|
|
|
t.Errorf("got fingerprint %v, want fingerprint %v", gotFP, wantFP)
|
|
|
|
}
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
gotFP = mapper.mapFP(fp3, cm32)
|
2015-08-20 08:18:46 -07:00
|
|
|
if wantFP := model.Fingerprint(5); gotFP != wantFP {
|
2015-05-06 07:53:12 -07:00
|
|
|
t.Errorf("got fingerprint %v, want fingerprint %v", gotFP, wantFP)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Remove all the fingerprints from sm, which should change nothing, as
|
|
|
|
// the existing mappings stay and should be detected.
|
|
|
|
sm.del(fp1)
|
|
|
|
sm.del(fp2)
|
|
|
|
sm.del(fp3)
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
gotFP = mapper.mapFP(fp1, cm11)
|
2015-05-06 07:53:12 -07:00
|
|
|
if wantFP := fp1; gotFP != wantFP {
|
|
|
|
t.Errorf("got fingerprint %v, want fingerprint %v", gotFP, wantFP)
|
|
|
|
}
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
gotFP = mapper.mapFP(fp1, cm12)
|
2015-08-20 08:18:46 -07:00
|
|
|
if wantFP := model.Fingerprint(1); gotFP != wantFP {
|
2015-05-06 07:53:12 -07:00
|
|
|
t.Errorf("got fingerprint %v, want fingerprint %v", gotFP, wantFP)
|
|
|
|
}
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
gotFP = mapper.mapFP(fp1, cm13)
|
2015-08-20 08:18:46 -07:00
|
|
|
if wantFP := model.Fingerprint(2); gotFP != wantFP {
|
2015-05-06 07:53:12 -07:00
|
|
|
t.Errorf("got fingerprint %v, want fingerprint %v", gotFP, wantFP)
|
|
|
|
}
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
gotFP = mapper.mapFP(fp2, cm21)
|
2015-05-06 07:53:12 -07:00
|
|
|
if wantFP := fp2; gotFP != wantFP {
|
|
|
|
t.Errorf("got fingerprint %v, want fingerprint %v", gotFP, wantFP)
|
|
|
|
}
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
gotFP = mapper.mapFP(fp2, cm22)
|
2015-08-20 08:18:46 -07:00
|
|
|
if wantFP := model.Fingerprint(3); gotFP != wantFP {
|
2015-05-06 07:53:12 -07:00
|
|
|
t.Errorf("got fingerprint %v, want fingerprint %v", gotFP, wantFP)
|
|
|
|
}
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
gotFP = mapper.mapFP(fp3, cm31)
|
2015-08-20 08:18:46 -07:00
|
|
|
if wantFP := model.Fingerprint(4); gotFP != wantFP {
|
2015-05-06 07:53:12 -07:00
|
|
|
t.Errorf("got fingerprint %v, want fingerprint %v", gotFP, wantFP)
|
|
|
|
}
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
gotFP = mapper.mapFP(fp3, cm32)
|
2015-08-20 08:18:46 -07:00
|
|
|
if wantFP := model.Fingerprint(5); gotFP != wantFP {
|
2015-05-06 07:53:12 -07:00
|
|
|
t.Errorf("got fingerprint %v, want fingerprint %v", gotFP, wantFP)
|
|
|
|
}
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
err = mapper.checkpoint()
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
2015-05-06 07:53:12 -07:00
|
|
|
|
|
|
|
// Load the mapper anew from disk and then check all the mappings again
|
|
|
|
// to make sure all changes have made it to disk.
|
|
|
|
mapper, err = newFPMapper(sm, p)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
|
|
|
|
gotFP = mapper.mapFP(fp1, cm11)
|
2015-05-06 07:53:12 -07:00
|
|
|
if wantFP := fp1; gotFP != wantFP {
|
|
|
|
t.Errorf("got fingerprint %v, want fingerprint %v", gotFP, wantFP)
|
|
|
|
}
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
gotFP = mapper.mapFP(fp1, cm12)
|
2015-08-20 08:18:46 -07:00
|
|
|
if wantFP := model.Fingerprint(1); gotFP != wantFP {
|
2015-05-06 07:53:12 -07:00
|
|
|
t.Errorf("got fingerprint %v, want fingerprint %v", gotFP, wantFP)
|
|
|
|
}
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
gotFP = mapper.mapFP(fp1, cm13)
|
2015-08-20 08:18:46 -07:00
|
|
|
if wantFP := model.Fingerprint(2); gotFP != wantFP {
|
2015-05-06 07:53:12 -07:00
|
|
|
t.Errorf("got fingerprint %v, want fingerprint %v", gotFP, wantFP)
|
|
|
|
}
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
gotFP = mapper.mapFP(fp2, cm21)
|
2015-05-06 07:53:12 -07:00
|
|
|
if wantFP := fp2; gotFP != wantFP {
|
|
|
|
t.Errorf("got fingerprint %v, want fingerprint %v", gotFP, wantFP)
|
|
|
|
}
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
gotFP = mapper.mapFP(fp2, cm22)
|
2015-08-20 08:18:46 -07:00
|
|
|
if wantFP := model.Fingerprint(3); gotFP != wantFP {
|
2015-05-06 07:53:12 -07:00
|
|
|
t.Errorf("got fingerprint %v, want fingerprint %v", gotFP, wantFP)
|
|
|
|
}
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
gotFP = mapper.mapFP(fp3, cm31)
|
2015-08-20 08:18:46 -07:00
|
|
|
if wantFP := model.Fingerprint(4); gotFP != wantFP {
|
2015-05-06 07:53:12 -07:00
|
|
|
t.Errorf("got fingerprint %v, want fingerprint %v", gotFP, wantFP)
|
|
|
|
}
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
gotFP = mapper.mapFP(fp3, cm32)
|
2015-08-20 08:18:46 -07:00
|
|
|
if wantFP := model.Fingerprint(5); gotFP != wantFP {
|
2015-05-06 07:53:12 -07:00
|
|
|
t.Errorf("got fingerprint %v, want fingerprint %v", gotFP, wantFP)
|
|
|
|
}
|
|
|
|
|
|
|
|
// To make sure that the mapping layer is not queried if the FP is found
|
2015-05-08 07:36:46 -07:00
|
|
|
// in sm but the mapping layer is queried before going to the archive,
|
|
|
|
// now put fp1 with cm12 in sm and fp2 with cm22 into archive (which
|
|
|
|
// will never happen in practice as only mapped FPs are put into sm and
|
|
|
|
// the archive).
|
2015-05-06 07:53:12 -07:00
|
|
|
sm.put(fp1, &memorySeries{metric: cm12})
|
|
|
|
p.archiveMetric(fp2, cm22, 0, 0)
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
gotFP = mapper.mapFP(fp1, cm12)
|
2015-05-08 07:36:46 -07:00
|
|
|
if wantFP := fp1; gotFP != wantFP { // No mapping happened.
|
2015-05-06 07:53:12 -07:00
|
|
|
t.Errorf("got fingerprint %v, want fingerprint %v", gotFP, wantFP)
|
|
|
|
}
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
gotFP = mapper.mapFP(fp2, cm22)
|
2015-08-20 08:18:46 -07:00
|
|
|
if wantFP := model.Fingerprint(3); gotFP != wantFP { // Old mapping still applied.
|
2015-05-06 07:53:12 -07:00
|
|
|
t.Errorf("got fingerprint %v, want fingerprint %v", gotFP, wantFP)
|
|
|
|
}
|
|
|
|
|
|
|
|
// If we now map cm21, we should get a mapping as the collision with the
|
2015-05-08 07:36:46 -07:00
|
|
|
// archived metric is detected. Again, this is a pathological situation
|
|
|
|
// that must never happen in real operations. It's just staged here to
|
|
|
|
// test the expected behavior.
|
Checkpoint fingerprint mappings only upon shutdown
Before, we checkpointed after every newly detected fingerprint
collision, which is not a problem as long as collisions are
rare. However, with a sufficient number of metrics or particular
nature of the data set, there might be a lot of collisions, all to be
detected upon the first set of scrapes, and then the checkpointing
after each detection will take a quite long time (it's O(n²),
essentially).
Since we are rebuilding the fingerprint mapping during crash recovery,
the previous, very conservative approach didn't even buy us
anything. We only ever read from the checkpoint file after a clean
shutdown, so the only time we need to write the checkpoint file is
during a clean shutdown.
2016-04-14 07:02:37 -07:00
|
|
|
gotFP = mapper.mapFP(fp2, cm21)
|
2015-08-20 08:18:46 -07:00
|
|
|
if wantFP := model.Fingerprint(6); gotFP != wantFP {
|
2015-05-06 07:53:12 -07:00
|
|
|
t.Errorf("got fingerprint %v, want fingerprint %v", gotFP, wantFP)
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|