I'm assembling an upper from different parts. The only info I can find about 9mm headspace checking was this thread:
Right now I'm looking at a Spike's billet upper, CMMG ramped bolt and probably a 7" barrel from Adco....
There are two ways to check headspace.
One is to use a set of GO/NO GO gauges. Basically, you insert the gauges into the chamber one at a time and close the bolt on them. The bolt should close fully on the GO gauge and should not close on the NO GO gauge. This method doesn't tell you the exact measurement of the chamber, but tells you if it is within spec.
The other way is to simply measure the chamber. On a 9mm AR, you need to measure the chamber in the barrel itself and the recess in the bolt face, then add those two measurements together to get the total chamber length/depth.