@@ -3118,23 +3118,8 @@ void Monitor::get_cluster_status(stringstream &ss, Formatter *f,
31183118 {
31193119 size_t maxlen = 3 ;
31203120 auto & service_map = mgrstatmon ()->get_service_map ();
3121- std::map<NvmeGroupKey, std::set<std::string>> nvmeof_services;
31223121 for (auto & p : service_map.services ) {
3123- if (p.first == " nvmeof" ) {
3124- auto daemons = p.second .daemons ;
3125- for (auto & d : daemons) {
3126- auto group = d.second .metadata .find (" group" );
3127- auto pool = d.second .metadata .find (" pool_name" );
3128- auto gw_id = d.second .metadata .find (" id" );
3129- NvmeGroupKey group_key = std::make_pair (pool->second , group->second );
3130- nvmeof_services[group_key].insert (gw_id->second );
3131- maxlen = std::max (maxlen,
3132- p.first .size () + group->second .size () + pool->second .size () + 4
3133- ); // nvmeof (pool.group):
3134- }
3135- } else {
3136- maxlen = std::max (maxlen, p.first .size ());
3137- }
3122+ maxlen = std::max (maxlen, p.first .size ());
31383123 }
31393124 string spacing (maxlen - 3 , ' ' );
31403125 const auto quorum_names = get_quorum_names ();
@@ -3181,31 +3166,8 @@ void Monitor::get_cluster_status(stringstream &ss, Formatter *f,
31813166 if (ServiceMap::is_normal_ceph_entity (service)) {
31823167 continue ;
31833168 }
3184- if (p.first == " nvmeof" ) {
3185- auto created_gws = nvmegwmon ()->get_map ().created_gws ;
3186- for (const auto & created_map_pair: created_gws) {
3187- const auto & group_key = created_map_pair.first ;
3188- const NvmeGwMonStates& gw_created_map = created_map_pair.second ;
3189- const int total = gw_created_map.size ();
3190- auto & active_gws = nvmeof_services[group_key];
3191-
3192- ss << " " << p.first << " (" << group_key.first << " ." << group_key.second << " ): " ;
3193- ss << string (maxlen - p.first .size () - group_key.first .size ()
3194- - group_key.second .size () - 4 , ' ' );
3195- ss << total << " gateway" << (total > 1 ? " s" : " " ) << " : "
3196- << active_gws.size () << " active (" ;
3197- for (auto gw = active_gws.begin (); gw != active_gws.end (); ++gw){
3198- if (gw != active_gws.begin ()) {
3199- ss << " , " ;
3200- }
3201- ss << *gw;
3202- }
3203- ss << " ) \n " ;
3204- }
3205- } else {
32063169 ss << " " << p.first << " : " << string (maxlen - p.first .size (), ' ' )
32073170 << p.second .get_summary () << " \n " ;
3208- }
32093171 }
32103172 }
32113173
0 commit comments