Skip to content

Latest commit

 

History

History
19 lines (10 loc) · 1.4 KB

packing-tools.md

File metadata and controls

19 lines (10 loc) · 1.4 KB

Some basic tools for packaging

In go-ethereum project, there is a small module golang ecosystem in some excellent tools package, due to the simple function, a chapter alone far too thin. However, because Ethereum's packaging of these gadgets is very elegant, it has strong independence and practicality. We do some analysis here, at least for the familiarity with the encoding of the Ethereum source code.

metrics

In ethdb-analysis, we saw the encapsulation of thegoleveldbproject. Ethdb abstracts a layer on goleveldb.

type Database interface

In order to support the use of the same interface with MemDatabase, it also uses a lot of probe tools under the gometrics package in LDBDatabase , and can start a goroutine execution.

go db.meter(3 * time.Second)

Collect the delay and I/O data volume in the goleveldb process in a 3-second cycle. It seems convenient, but the question is how do we use the information we collect?

log

Golang's built-in log package has always been used as a slot, and the Ethereum project is no exception. Therefore log15 was introduced to solve the problem of inconvenient log usage.