MCPcopy Create free account
hub / github.com/rabbitstack/fibratus / Store

Method Store

pkg/event/sequencer_windows.go:73–89  ·  view source on GitHub ↗

Store saves the current sequence value in the registry.

()

Source from the content-addressed store, hash-verified

71
72// Store saves the current sequence value in the registry.
73func (s *Sequencer) Store() error {
74 if s.key == invalidKey {
75 // try to open the key again
76 var err error
77 access := uint32(registry.QUERY_VALUE | registry.SET_VALUE)
78 s.key, err = registry.OpenKey(registry.CURRENT_USER, "Volatile Environment", access)
79 if err != nil {
80 return errInvalidVolatileKey
81 }
82 }
83 nextSeq := s.Get()
84 prevSeq, _, err := s.key.GetIntegerValue(seqVName)
85 if err == nil && nextSeq < prevSeq {
86 return fmt.Errorf("current sequence number %d is lower than registry value %d", nextSeq, prevSeq)
87 }
88 return s.key.SetQWordValue(seqVName, nextSeq)
89}
90
91// Increment increments the sequence number atomically.
92func (s *Sequencer) Increment() {

Callers 10

TestSequencerFunction · 0.95
TestSequencerMonotonicFunction · 0.95
ShutdownMethod · 0.95
storeMethod · 0.95
initFSMMethod · 0.80
addPartialMethod · 0.80
clearMethod · 0.80
expireMethod · 0.80
CloseMethod · 0.80

Calls 1

GetMethod · 0.95

Tested by 2

TestSequencerFunction · 0.76
TestSequencerMonotonicFunction · 0.76