I think productivity can only only measured towards a goal. Setting different goals will require different metrics and tools for improvement. If your goal is to become for example, a Factorio expert, you can measure your productivity towards this goal by the number of hours spent playing the game. If on the other hand, you are considering becoming a VHDL expert, you could improve your productivity by gaining proficiency in language constructs, syntax rules, and design abstractions so they become second nature and you could do this by copying existing educational designs, attending trainings, reading books.
If yet on on the other third hand, your goal is to maximize your free(idle) time, then you can measure your productivity by rejecting tasks thrown at you and spending less time on hacker news :)
If yet on on the other third hand, your goal is to maximize your free(idle) time, then you can measure your productivity by rejecting tasks thrown at you and spending less time on hacker news :)