Block explorer websites will run full node(s) of their own, and then use data obtained by their node(s) to calculate and present much of the info shown on their website. Not all info shown on the block explorer sites is explicitly present in the block data, some may be calculated or inferred by the block explorer website.
Relayed By", there was a block that was listed as unknown on blockchain.info and showed as "relayed by" by specific mining pool on btc.com
This information is not present in the block, so block explorer websites must use another method to determine it. Note that the peer you hear about a new block from is not necessarily the peer that mined that block.
Is there a way to figure out hash rate of specific mining pool as a % of total in the real time.
This information is also not included in a block.
The total amount of hashing power pointed at the network cannot be measured directly, rather it can be calculated by considering the current difficulty, and the rate of block generation. Knowing the total, you can count how many blocks (of the last x blocks) were generated by a certain pool, to estimate that pool's share of the total hashing power over that time frame.
Note that there is no requirement for a miner to put their name on a mined block, but historically many miners have elected to do so.
For these reasons, it is not possible to make a real time measurement of the hashpower controlled by a certain pool, and even the method described above is not guaranteed to be accurate.
Are you referring to solo miners? I was inquiring regarding mining pool? How does blockchain.infor or similar sites figure out which mining pool mined specific block? – Dmitry Savelyev – 2018-05-24T22:04:09.490
The details apply to both solo miners and mining pools. Most mining pools add some text to a special field in blocks (called the "coinbase field", not directly related to the company); block explorers like Blockchain.info look at this text and guess which pool created the block. However, pools don't just put their names there, so you need to guess which pool uses which text, and anyone can put any text they want, so there's no guarantee a particular pool created a block attributed to it. – David A. Harding – 2018-05-25T11:12:27.947