net.i2p.router.peermanager

## Class DBHistory

- java.lang.Object
- - net.i2p.router.peermanager.DBHistory

-     public class DBHistory
      extends Object

  History of NetDb related activities (lookups, replies, stores, etc)

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DBHistory(RouterContext context, String statGroup)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `coalesceStats()`
    `long` | `getAvgDelayBetweenLookupsReceived()` Deprecated. unused
    `RateStat` | `getFailedLookupRate()` how often does the peer fail to reply to a lookup request, broken into 1 hour and 1 day periods.
    `long` | `getFailedLookups()` Deprecated. unused
    `RateStat` | `getInvalidReplyRate()` not sure how much this is used, to be investigated
    `long` | `getLastLookupFailed()`
    `long` | `getLastLookupReceived()` Deprecated. unused
    `long` | `getLastLookupSuccessful()`
    `long` | `getLastStoreFailed()`
    `long` | `getLastStoreSuccessful()`
    `long` | `getLookupReplyDuplicate()` Deprecated. unused
    `long` | `getLookupReplyInvalid()` Deprecated. unused
    `long` | `getLookupReplyNew()` Deprecated. unused
    `long` | `getLookupReplyOld()` Deprecated. unused
    `long` | `getLookupsReceived()` Deprecated. unused
    `long` | `getSuccessfulLookups()` Deprecated. unused
    `long` | `getUnpromptedDbStoreNew()` how many times have they sent us data we didn't ask for and that we've never seen?
    `long` | `getUnpromptedDbStoreOld()` how many times have they sent us data we didn't ask for but that we have seen?
    `void` | `load(Properties props)`
    `void` | `lookupFailed()` Note that the peer failed to respond to the db lookup in any way
    `void` | `lookupReceived()` Note that the peer sent us a lookup
    `void` | `lookupReply(int newPeers, int oldPeers, int invalid, int duplicate)` Receive a lookup reply from the peer, where they gave us the specified info
    `void` | `lookupSuccessful()` Note that the peer was not only able to respond to the lookup, but sent us the data we wanted!
    `void` | `setAvgDelayBetweenLookupsReceived(long ms)`
    `void` | `setFailedLookups(long num)`
    `void` | `setLastLookupReceived(long when)`
    `void` | `setLookupReplyDuplicate(long num)`
    `void` | `setLookupReplyInvalid(long num)`
    `void` | `setLookupReplyNew(long num)`
    `void` | `setLookupReplyOld(long num)`
    `void` | `setLookupsReceived(long num)`
    `void` | `setSuccessfulLookups(long num)`
    `void` | `setUnpromptedDbStoreNew(long num)`
    `void` | `setUnpromptedDbStoreOld(long num)`
    `void` | `store(OutputStream out)`
    `void` | `storeFailed()` Note that floodfill verify failed
    `void` | `storeSuccessful()` Note that we successfully stored to a floodfill peer and verified the result by asking another floodfill peer
    `void` | `unpromptedStoreReceived(boolean wasNew)` Note that the peer sent us a data point without us asking for it

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DBHistory

          public DBHistory(RouterContext context,
                   String statGroup)

  - ### Method Detail

    - #### getSuccessfulLookups

          public long getSuccessfulLookups()

      Deprecated. unused
      how many times we have sent them a db lookup and received the value back from them

    - #### getFailedLookups

          public long getFailedLookups()

      Deprecated. unused
      how many times we have sent them a db lookup and not received the value or a lookup reply

    - #### getLookupReplyNew

          public long getLookupReplyNew()

      Deprecated. unused
      how many peers that we have never seen before did lookups provide us with?

    - #### getLookupReplyOld

          public long getLookupReplyOld()

      Deprecated. unused
      how many peers that we have already seen did lookups provide us with?

    - #### getLookupReplyDuplicate

          public long getLookupReplyDuplicate()

      Deprecated. unused
      how many peers that we explicitly asked the peer not to send us did they reply with?

    - #### getLookupReplyInvalid

          public long getLookupReplyInvalid()

      Deprecated. unused
      how many peers that were incorrectly formatted / expired / otherwise illegal did lookups provide us with?

    - #### getLookupsReceived

          public long getLookupsReceived()

      Deprecated. unused
      how many lookups this peer has sent us?

    - #### getAvgDelayBetweenLookupsReceived

          public long getAvgDelayBetweenLookupsReceived()

      Deprecated. unused
      how frequently do they send us lookup requests?

    - #### getLastLookupReceived

          public long getLastLookupReceived()

      Deprecated. unused
      when did they last send us a request?

    - #### getLastLookupSuccessful

          public long getLastLookupSuccessful()

    - #### getLastLookupFailed

          public long getLastLookupFailed()

    - #### getLastStoreSuccessful

          public long getLastStoreSuccessful()

    - #### getLastStoreFailed

          public long getLastStoreFailed()

    - #### getUnpromptedDbStoreNew

          public long getUnpromptedDbStoreNew()

      how many times have they sent us data we didn't ask for and that we've never seen?

    - #### getUnpromptedDbStoreOld

          public long getUnpromptedDbStoreOld()

      how many times have they sent us data we didn't ask for but that we have seen?

    - #### getFailedLookupRate

          public RateStat getFailedLookupRate()

      how often does the peer fail to reply to a lookup request, broken into 1 hour and 1 day periods.

    - #### getInvalidReplyRate

          public RateStat getInvalidReplyRate()

      not sure how much this is used, to be investigated

    - #### lookupSuccessful

          public void lookupSuccessful()

      Note that the peer was not only able to respond to the lookup, but sent us the data we wanted!

    - #### lookupFailed

          public void lookupFailed()

      Note that the peer failed to respond to the db lookup in any way

    - #### storeSuccessful

          public void storeSuccessful()

      Note that we successfully stored to a floodfill peer and verified the result by asking another floodfill peer

    - #### storeFailed

          public void storeFailed()

      Note that floodfill verify failed

    - #### lookupReply

          public void lookupReply(int newPeers,
                         int oldPeers,
                         int invalid,
                         int duplicate)

      Receive a lookup reply from the peer, where they gave us the specified info
      Parameters:
        `newPeers` - number of peers we have never seen before
        `oldPeers` - number of peers we have seen before
        `invalid` - number of peers that are invalid / out of date / otherwise b0rked
        `duplicate` - number of peers we asked them not to give us (though they're allowed to send us themselves if they don't know anyone else)

    - #### lookupReceived

          public void lookupReceived()

      Note that the peer sent us a lookup

    - #### unpromptedStoreReceived

          public void unpromptedStoreReceived(boolean wasNew)

      Note that the peer sent us a data point without us asking for it
      Parameters:
        `wasNew` - whether we already knew about this data point or not

    - #### setSuccessfulLookups

          public void setSuccessfulLookups(long num)

    - #### setFailedLookups

          public void setFailedLookups(long num)

    - #### setLookupReplyNew

          public void setLookupReplyNew(long num)

    - #### setLookupReplyOld

          public void setLookupReplyOld(long num)

    - #### setLookupReplyInvalid

          public void setLookupReplyInvalid(long num)

    - #### setLookupReplyDuplicate

          public void setLookupReplyDuplicate(long num)

    - #### setLookupsReceived

          public void setLookupsReceived(long num)

    - #### setAvgDelayBetweenLookupsReceived

          public void setAvgDelayBetweenLookupsReceived(long ms)

    - #### setLastLookupReceived

          public void setLastLookupReceived(long when)

    - #### setUnpromptedDbStoreNew

          public void setUnpromptedDbStoreNew(long num)

    - #### setUnpromptedDbStoreOld

          public void setUnpromptedDbStoreOld(long num)

    - #### coalesceStats

          public void coalesceStats()

    - #### store

          public void store(OutputStream out)
                     throws IOException

      Throws:
        `IOException`

    - #### load

          public void load(Properties props)