P1 metering for Java