  In this paper, we introduce an invariant of Cohen-Macaulay local rings in
terms of the reduction number of canonical ideals. The invariant can be defined
in arbitrary Cohen-Macaulay rings and it measures how close to being
Gorenstein. First, we clarify the relation between almost Gorenstein rings and
nearly Gorenstein rings by using the invariant in dimension one. We next
characterize the idealization of trace ideals over Gorenstein rings in terms of
the invariant. It provides better prospects for a result of the almost
Gorenstein property of idealization.
