To calculate the «length» of a domain, you would need an interface marker of the facets of the subdomain, or you can create a submesh for each subdomain and then evaluate ds as done for the full mesh.
Note that your example is not reproducible as you haven’t provided a mesh.
If you want to make an interface marker after meshing see